﻿using System;
using System.Collections;
using System.Collections.Generic;
using PlaygroundSplines;
using UnityEngine;

namespace ParticlePlayground
{
	// Token: 0x02000197 RID: 407
	[ExecuteInEditMode]
	[RequireComponent(typeof(ParticleSystem))]
	public class PlaygroundParticlesC : MonoBehaviour
	{
		// Token: 0x060008C2 RID: 2242 RVA: 0x00034674 File Offset: 0x00032874
		public virtual void CopyTo(PlaygroundParticlesC playgroundParticles)
		{
			playgroundParticles.source = this.source;
			playgroundParticles.activeState = this.activeState;
			playgroundParticles.emit = this.emit;
			playgroundParticles.loop = this.loop;
			playgroundParticles.clearParticlesOnEmissionStop = this.clearParticlesOnEmissionStop;
			playgroundParticles.disableOnDone = this.disableOnDone;
			playgroundParticles.disableOnDoneRoutine = this.disableOnDoneRoutine;
			playgroundParticles.updateRate = this.updateRate;
			playgroundParticles.calculate = this.calculate;
			playgroundParticles.calculateDeltaMovement = this.calculateDeltaMovement;
			playgroundParticles.deltaMovementStrength = this.deltaMovementStrength;
			playgroundParticles.minDeltaMovementStrength = this.minDeltaMovementStrength;
			playgroundParticles.deltaMovementStrengthValueMethod = this.deltaMovementStrengthValueMethod;
			playgroundParticles.worldObjectUpdateVertices = this.worldObjectUpdateVertices;
			playgroundParticles.worldObjectUpdateNormals = this.worldObjectUpdateNormals;
			playgroundParticles.nearestNeighborOrigin = this.nearestNeighborOrigin;
			playgroundParticles.nearestNeighborOriginMethod = this.nearestNeighborOriginMethod;
			playgroundParticles.nearestNeighborOriginTransform = this.nearestNeighborOriginTransform;
			playgroundParticles.nearestNeighborOriginVector3 = this.nearestNeighborOriginVector3;
			playgroundParticles.particleCount = this.particleCount;
			playgroundParticles.emissionRate = this.emissionRate;
			playgroundParticles.overflowMode = this.overflowMode;
			playgroundParticles.overflowOffset = this.overflowOffset;
			playgroundParticles.applySourceScatter = this.applySourceScatter;
			playgroundParticles.scatterScale = this.scatterScale;
			playgroundParticles.sourceScatterMin = this.sourceScatterMin;
			playgroundParticles.sourceScatterMax = this.sourceScatterMax;
			playgroundParticles.sourceScatterMethod = this.sourceScatterMethod;
			playgroundParticles.sorting = this.sorting;
			playgroundParticles.lifetimeSorting = new AnimationCurve(this.lifetimeSorting.keys);
			playgroundParticles.sizeMin = this.sizeMin;
			playgroundParticles.sizeMax = this.sizeMax;
			playgroundParticles.scale = this.scale;
			playgroundParticles.initialRotationMin = this.initialRotationMin;
			playgroundParticles.initialRotationMax = this.initialRotationMax;
			playgroundParticles.rotationSpeedMin = this.rotationSpeedMin;
			playgroundParticles.rotationSpeedMax = this.rotationSpeedMax;
			playgroundParticles.rotateTowardsDirection = this.rotateTowardsDirection;
			playgroundParticles.rotationNormal = this.rotationNormal;
			playgroundParticles.lifetime = this.lifetime;
			playgroundParticles.lifetimeValueMethod = this.lifetimeValueMethod;
			playgroundParticles.lifetimeMin = this.lifetimeMin;
			playgroundParticles.lifetimeEmission = this.lifetimeEmission;
			playgroundParticles.lifetimeOffset = this.lifetimeOffset;
			playgroundParticles.minShurikenLifetime = this.minShurikenLifetime;
			playgroundParticles.applyLifetimeSize = this.applyLifetimeSize;
			playgroundParticles.lifetimeSize = new AnimationCurve(this.lifetimeSize.keys);
			playgroundParticles.applyParticleArraySize = this.applyParticleArraySize;
			playgroundParticles.particleArraySize = new AnimationCurve(this.particleArraySize.keys);
			playgroundParticles.transitionBackToSource = this.transitionBackToSource;
			playgroundParticles.transitionBackToSourceAmount = new AnimationCurve(this.transitionBackToSourceAmount.keys);
			playgroundParticles.onlySourcePositioning = this.onlySourcePositioning;
			playgroundParticles.onlyLifetimePositioning = this.onlyLifetimePositioning;
			playgroundParticles.lifetimePositioning = this.lifetimePositioning.Clone();
			playgroundParticles.lifetimePositioningScale = this.lifetimePositioningScale;
			playgroundParticles.lifetimePositioningUsesSourceDirection = this.lifetimePositioningUsesSourceDirection;
			playgroundParticles.lifetimePositioningTimeScale = new AnimationCurve(this.lifetimePositioningTimeScale.keys);
			playgroundParticles.lifetimePositioningPositionScale = new AnimationCurve(this.lifetimePositioningPositionScale.keys);
			playgroundParticles.applyLifetimePositioningTimeScale = this.applyLifetimePositioningTimeScale;
			playgroundParticles.applyLifetimePositioningPositionScale = this.applyLifetimePositioningPositionScale;
			playgroundParticles.axisConstraints = this.axisConstraints.Clone();
			playgroundParticles.applyLifetimeVelocity = this.applyLifetimeVelocity;
			playgroundParticles.lifetimeVelocity = this.lifetimeVelocity.Clone();
			playgroundParticles.lifetimeVelocityScale = this.lifetimeVelocityScale;
			playgroundParticles.applyInitialVelocity = this.applyInitialVelocity;
			playgroundParticles.initialVelocityMin = this.initialVelocityMin;
			playgroundParticles.initialVelocityMax = this.initialVelocityMax;
			playgroundParticles.initialVelocityMethod = this.initialVelocityMethod;
			playgroundParticles.applyInitialLocalVelocity = this.applyInitialLocalVelocity;
			playgroundParticles.initialLocalVelocityMin = this.initialLocalVelocityMin;
			playgroundParticles.initialLocalVelocityMax = this.initialLocalVelocityMax;
			playgroundParticles.initialLocalVelocityMethod = this.initialLocalVelocityMethod;
			playgroundParticles.applyVelocityBending = this.applyVelocityBending;
			playgroundParticles.velocityBending = this.velocityBending;
			playgroundParticles.velocityBendingType = this.velocityBendingType;
			playgroundParticles.applyInitialVelocityShape = this.applyInitialVelocityShape;
			playgroundParticles.initialVelocityShape = this.initialVelocityShape.Clone();
			playgroundParticles.initialVelocityShapeScale = this.initialVelocityShapeScale;
			playgroundParticles.gravity = this.gravity;
			playgroundParticles.damping = this.damping;
			playgroundParticles.velocityScale = this.velocityScale;
			playgroundParticles.maxVelocity = this.maxVelocity;
			playgroundParticles.lifetimeColor.SetKeys(this.lifetimeColor.colorKeys, this.lifetimeColor.alphaKeys);
			playgroundParticles.colorSource = this.colorSource;
			playgroundParticles.sourceUsesLifetimeAlpha = this.sourceUsesLifetimeAlpha;
			playgroundParticles.colorMethod = this.colorMethod;
			playgroundParticles.arrayColorUsesAlpha = this.arrayColorUsesAlpha;
			playgroundParticles.arrayColorAlpha.SetKeys(this.arrayColorAlpha.colorKeys, this.arrayColorAlpha.alphaKeys);
			playgroundParticles.applyLocalSpaceMovementCompensation = this.applyLocalSpaceMovementCompensation;
			playgroundParticles.applyRandomSizeOnRebirth = this.applyRandomSizeOnRebirth;
			playgroundParticles.applyRandomInitialVelocityOnRebirth = this.applyRandomInitialVelocityOnRebirth;
			playgroundParticles.applyRandomRotationOnRebirth = this.applyRandomRotationOnRebirth;
			playgroundParticles.applyRandomScatterOnRebirth = this.applyRandomScatterOnRebirth;
			playgroundParticles.applyInitialColorOnRebirth = this.applyInitialColorOnRebirth;
			playgroundParticles.applyRandomLifetimeOnRebirth = this.applyRandomLifetimeOnRebirth;
			playgroundParticles.applyDeltaOnRebirth = this.applyDeltaOnRebirth;
			playgroundParticles.calculateManipulatorOnRebirth = this.calculateManipulatorOnRebirth;
			playgroundParticles.pauseCalculationWhenInvisible = this.pauseCalculationWhenInvisible;
			playgroundParticles.calculationTriggerSize = this.calculationTriggerSize;
			playgroundParticles.calculationTriggerOffset = this.calculationTriggerOffset;
			playgroundParticles.calculationTriggerTransform = this.calculationTriggerTransform;
			playgroundParticles.calculationTriggerSizeGizmo = this.calculationTriggerSizeGizmo;
			playgroundParticles.forceVisibilityWhenOutOfFrustrum = this.forceVisibilityWhenOutOfFrustrum;
			playgroundParticles.syncPositionsOnMainThread = this.syncPositionsOnMainThread;
			playgroundParticles.applyLockPosition = this.applyLockPosition;
			playgroundParticles.applyLockRotation = this.applyLockRotation;
			playgroundParticles.applyLockScale = this.applyLockScale;
			playgroundParticles.lockPositionIsLocal = this.lockPositionIsLocal;
			playgroundParticles.lockRotationIsLocal = this.lockRotationIsLocal;
			playgroundParticles.lockPosition = this.lockPosition;
			playgroundParticles.lockRotation = this.lockRotation;
			playgroundParticles.lockScale = this.lockScale;
			playgroundParticles.applyMovementCompensationLifetimeStrength = this.applyMovementCompensationLifetimeStrength;
			playgroundParticles.movementCompensationLifetimeStrength = new AnimationCurve(this.movementCompensationLifetimeStrength.keys);
			playgroundParticles.applyParticleMask = this.applyParticleMask;
			playgroundParticles.particleMask = this.particleMask;
			playgroundParticles.particleMaskTime = this.particleMaskTime;
			playgroundParticles.particleMaskSorting = this.particleMaskSorting;
			playgroundParticles.stretchSpeed = this.stretchSpeed;
			playgroundParticles.applyStretchStartDirection = this.applyStretchStartDirection;
			playgroundParticles.applyLifetimeStretching = this.applyLifetimeStretching;
			playgroundParticles.stretchLifetime = new AnimationCurve(this.stretchLifetime.keys);
			playgroundParticles.threadMethod = this.threadMethod;
			playgroundParticles.multithreadedStartup = this.multithreadedStartup;
			playgroundParticles.scriptedEmissionIndex = this.scriptedEmissionIndex;
			playgroundParticles.scriptedEmissionPosition = this.scriptedEmissionPosition;
			playgroundParticles.scriptedEmissionVelocity = this.scriptedEmissionVelocity;
			playgroundParticles.scriptedEmissionColor = this.scriptedEmissionColor;
			playgroundParticles.collision = this.collision;
			playgroundParticles.affectRigidbodies = this.affectRigidbodies;
			playgroundParticles.inverseRigidbodyCollision = this.inverseRigidbodyCollision;
			playgroundParticles.mass = this.mass;
			playgroundParticles.collisionRadius = this.collisionRadius;
			playgroundParticles.collisionMask = this.collisionMask;
			playgroundParticles.bounciness = this.bounciness;
			playgroundParticles.lifetimeLoss = this.lifetimeLoss;
			playgroundParticles.bounceRandomMin = this.bounceRandomMin;
			playgroundParticles.bounceRandomMax = this.bounceRandomMax;
			playgroundParticles.collisionType = this.collisionType;
			playgroundParticles.minCollisionDepth = this.minCollisionDepth;
			playgroundParticles.maxCollisionDepth = this.maxCollisionDepth;
			playgroundParticles.stickyCollisions = this.stickyCollisions;
			playgroundParticles.stickyCollisionsSurfaceOffset = this.stickyCollisionsSurfaceOffset;
			playgroundParticles.stickyCollisionsMask = this.stickyCollisionsMask;
			playgroundParticles.collisionPrecision = this.collisionPrecision;
			playgroundParticles.forceCollisionCaching = this.forceCollisionCaching;
			playgroundParticles.maskedParticlesBypassCollision = this.maskedParticlesBypassCollision;
			playgroundParticles.collisionExclusion = new List<Transform>();
			for (int i = 0; i < this.collisionExclusion.Count; i++)
			{
				playgroundParticles.collisionExclusion.Add(this.collisionExclusion[i]);
			}
			playgroundParticles.colliders = new List<PlaygroundColliderC>();
			for (int j = 0; j < this.colliders.Count; j++)
			{
				playgroundParticles.colliders.Add(this.colliders[j].Clone());
			}
			playgroundParticles.states = new List<ParticleStateC>();
			for (int k = 0; k < this.states.Count; k++)
			{
				playgroundParticles.states.Add(this.states[k].Clone());
			}
			playgroundParticles.splines = new List<PlaygroundSplines.PlaygroundSpline>();
			for (int l = 0; l < this.splines.Count; l++)
			{
				playgroundParticles.splines.Add(this.splines[l]);
			}
			playgroundParticles.splineTimeOffset = this.splineTimeOffset;
			playgroundParticles.treatAsOneSpline = this.treatAsOneSpline;
			playgroundParticles.worldObject = this.worldObject.Clone();
			playgroundParticles.skinnedWorldObject = this.skinnedWorldObject.Clone();
			playgroundParticles.forceSkinnedMeshUpdateOnMainThread = this.forceSkinnedMeshUpdateOnMainThread;
			playgroundParticles.sourceTransform = this.sourceTransform;
			playgroundParticles.sourceTransforms = new List<PlaygroundTransformC>();
			for (int m = 0; m < this.sourceTransforms.Count; m++)
			{
				playgroundParticles.sourceTransforms.Add(this.sourceTransforms[m].Clone());
			}
			playgroundParticles.treatAsOneTransform = this.treatAsOneTransform;
			playgroundParticles.paint = this.paint.Clone();
			playgroundParticles.projection = this.projection.Clone();
			playgroundParticles.manipulators = new List<ManipulatorObjectC>();
			for (int n = 0; n < this.manipulators.Count; n++)
			{
				playgroundParticles.manipulators.Add(this.manipulators[n].Clone());
			}
			playgroundParticles.events = new List<PlaygroundEventC>();
			for (int num = 0; num < this.events.Count; num++)
			{
				playgroundParticles.events.Add(this.events[num].Clone());
			}
			playgroundParticles.lifetimeColors = new List<PlaygroundGradientC>();
			for (int num2 = 0; num2 < this.lifetimeColors.Count; num2++)
			{
				playgroundParticles.lifetimeColors.Add(new PlaygroundGradientC());
				this.lifetimeColors[num2].CopyTo(playgroundParticles.lifetimeColors[num2]);
			}
			playgroundParticles.turbulenceType = this.turbulenceType;
			playgroundParticles.turbulenceApplyLifetimeStrength = this.turbulenceApplyLifetimeStrength;
			playgroundParticles.turbulenceLifetimeStrength = new AnimationCurve(this.turbulenceLifetimeStrength.keys);
			playgroundParticles.turbulenceScale = this.turbulenceScale;
			playgroundParticles.turbulenceStrength = this.turbulenceStrength;
			playgroundParticles.turbulenceTimeScale = this.turbulenceTimeScale;
			playgroundParticles.particleTimescale = this.particleTimescale;
		}

		// Token: 0x060008C3 RID: 2243 RVA: 0x00035108 File Offset: 0x00033308
		public virtual void CopySaveDataTo(PlaygroundParticlesC playgroundParticles)
		{
			playgroundParticles.snapshots = new List<PlaygroundSave>();
			for (int i = 0; i < this.snapshots.Count; i++)
			{
				playgroundParticles.snapshots.Add(this.snapshots[i].Clone());
			}
		}

		// Token: 0x060008C4 RID: 2244 RVA: 0x00035158 File Offset: 0x00033358
		public virtual void Emit(bool setEmission)
		{
			this.emit = setEmission;
			if (this.emit)
			{
				this.simulationStarted = this.localTime;
				this.calculate = true;
				this.hasActiveParticles = true;
				this.threadHadNoActiveParticles = false;
				this.loopExceeded = false;
				this.loopExceededOnParticle = -1;
				if (this.thisInstance == null)
				{
					this.thisInstance = this;
				}
				this.particleSystemGameObject.SetActive(true);
				PlaygroundParticlesC.Emission(this.thisInstance, true, true);
			}
			else
			{
				this.emissionStopped = this.localTime;
				if (this.clearParticlesOnEmissionStop)
				{
					this.InactivateParticles();
				}
			}
			this.previousEmission = setEmission;
		}

		// Token: 0x060008C5 RID: 2245 RVA: 0x00035200 File Offset: 0x00033400
		public virtual int Emit()
		{
			this.source = SOURCEC.Script;
			int result = this.scriptedEmissionIndex;
			this.EmitProcedure(this.scriptedEmissionPosition, this.scriptedEmissionVelocity, this.scriptedEmissionColor);
			return result;
		}

		// Token: 0x060008C6 RID: 2246 RVA: 0x0003523C File Offset: 0x0003343C
		public virtual int Emit(Vector3 givePosition)
		{
			this.source = SOURCEC.Script;
			int result = this.scriptedEmissionIndex;
			this.EmitProcedure(givePosition, this.scriptedEmissionVelocity, this.scriptedEmissionColor);
			return result;
		}

		// Token: 0x060008C7 RID: 2247 RVA: 0x00035270 File Offset: 0x00033470
		public virtual int Emit(Vector3 givePosition, Vector3 giveVelocity)
		{
			this.source = SOURCEC.Script;
			int result = this.scriptedEmissionIndex;
			this.EmitProcedure(givePosition, giveVelocity, this.scriptedEmissionColor);
			return result;
		}

		// Token: 0x060008C8 RID: 2248 RVA: 0x000352A0 File Offset: 0x000334A0
		public virtual int Emit(Vector3 givePosition, Vector3 giveVelocity, Color32 giveColor)
		{
			this.source = SOURCEC.Script;
			int result = this.scriptedEmissionIndex;
			this.EmitProcedure(givePosition, giveVelocity, giveColor);
			return result;
		}

		// Token: 0x060008C9 RID: 2249 RVA: 0x000352C8 File Offset: 0x000334C8
		public virtual void Emit(int quantity)
		{
			this.source = SOURCEC.Script;
			for (int i = 0; i < quantity; i++)
			{
				this.EmitProcedure(this.scriptedEmissionPosition, this.scriptedEmissionVelocity, this.scriptedEmissionColor);
			}
		}

		// Token: 0x060008CA RID: 2250 RVA: 0x0003530C File Offset: 0x0003350C
		public virtual void Emit(int quantity, Vector3 givePosition, Vector3 randomVelocityMin, Vector3 randomVelocityMax, Color32 giveColor)
		{
			this.source = SOURCEC.Script;
			for (int i = 0; i < quantity; i++)
			{
				this.EmitProcedure(givePosition, (!this.applyInitialVelocityShape) ? PlaygroundParticlesC.RandomRange(this.internalRandom01, randomVelocityMin, randomVelocityMax) : Vector3.Scale(PlaygroundParticlesC.RandomRange(this.internalRandom01, randomVelocityMin, randomVelocityMax), this.initialVelocityShape.Evaluate((float)i * 1f / ((float)quantity * 1f), this.initialVelocityShapeScale)), giveColor);
			}
		}

		// Token: 0x060008CB RID: 2251 RVA: 0x00035390 File Offset: 0x00033590
		public virtual void Emit(int quantity, Vector3 randomPositionMin, Vector3 randomPositionMax, Vector3 randomVelocityMin, Vector3 randomVelocityMax, Color32 giveColor)
		{
			this.source = SOURCEC.Script;
			for (int i = 0; i < quantity; i++)
			{
				this.EmitProcedure(PlaygroundParticlesC.RandomRange(this.internalRandom01, randomPositionMin, randomPositionMax), (!this.applyInitialVelocityShape) ? PlaygroundParticlesC.RandomRange(this.internalRandom01, randomVelocityMin, randomVelocityMax) : Vector3.Scale(PlaygroundParticlesC.RandomRange(this.internalRandom01, randomVelocityMin, randomVelocityMax), this.initialVelocityShape.Evaluate((float)i * 1f / ((float)quantity * 1f), this.initialVelocityShapeScale)), giveColor);
			}
		}

		// Token: 0x060008CC RID: 2252 RVA: 0x00035420 File Offset: 0x00033620
		public virtual int Emit(float giveLifetime)
		{
			this.source = SOURCEC.Script;
			int result = this.scriptedEmissionIndex;
			this.scriptedLifetime = giveLifetime;
			this.EmitProcedure(this.scriptedEmissionPosition, this.scriptedEmissionVelocity, this.scriptedEmissionColor);
			this.scriptedLifetime = 0f;
			return result;
		}

		// Token: 0x060008CD RID: 2253 RVA: 0x0003546C File Offset: 0x0003366C
		public virtual int Emit(Vector3 givePosition, float giveLifetime)
		{
			this.source = SOURCEC.Script;
			int result = this.scriptedEmissionIndex;
			this.scriptedLifetime = giveLifetime;
			this.EmitProcedure(givePosition, this.scriptedEmissionVelocity, this.scriptedEmissionColor);
			this.scriptedLifetime = 0f;
			return result;
		}

		// Token: 0x060008CE RID: 2254 RVA: 0x000354B4 File Offset: 0x000336B4
		public virtual int Emit(Vector3 givePosition, Vector3 giveVelocity, float giveLifetime)
		{
			this.source = SOURCEC.Script;
			int result = this.scriptedEmissionIndex;
			this.scriptedLifetime = giveLifetime;
			this.EmitProcedure(givePosition, giveVelocity, this.scriptedEmissionColor);
			this.scriptedLifetime = 0f;
			return result;
		}

		// Token: 0x060008CF RID: 2255 RVA: 0x000354F8 File Offset: 0x000336F8
		public virtual int Emit(Vector3 givePosition, Vector3 giveVelocity, float giveLifetime, Color32 giveColor)
		{
			this.source = SOURCEC.Script;
			int result = this.scriptedEmissionIndex;
			this.scriptedLifetime = giveLifetime;
			this.EmitProcedure(givePosition, giveVelocity, giveColor);
			this.scriptedLifetime = 0f;
			return result;
		}

		// Token: 0x060008D0 RID: 2256 RVA: 0x00035530 File Offset: 0x00033730
		public virtual void ThreadSafeEmit(Vector3 givePosition, Vector3 giveVelocity, Color32 giveColor)
		{
			this.EmitProcedure(givePosition, giveVelocity, giveColor);
		}

		// Token: 0x060008D1 RID: 2257 RVA: 0x0003553C File Offset: 0x0003373C
		public virtual void ThreadSafeEmit(int quantity, Vector3 givePosition, Vector3 randomVelocityMin, Vector3 randomVelocityMax, Color32 giveColor)
		{
			for (int i = 0; i < quantity; i++)
			{
				this.EmitProcedure(givePosition, (!this.applyInitialVelocityShape) ? PlaygroundParticlesC.RandomRange(this.internalRandom01, randomVelocityMin, randomVelocityMax) : Vector3.Scale(PlaygroundParticlesC.RandomRange(this.internalRandom01, randomVelocityMin, randomVelocityMax), this.initialVelocityShape.Evaluate((float)i * 1f / ((float)quantity * 1f), this.initialVelocityShapeScale)), giveColor);
			}
		}

		// Token: 0x060008D2 RID: 2258 RVA: 0x000355B8 File Offset: 0x000337B8
		public virtual void EmitProcedure(Vector3 givePosition, Vector3 giveVelocity, Color32 giveColor)
		{
			this.scriptedEmissionIndex %= this.particleCount;
			this.scriptedEmissionPosition = givePosition;
			this.scriptedEmissionVelocity = giveVelocity;
			this.scriptedEmissionColor = giveColor;
			this.hasActiveParticles = true;
			this.threadHadNoActiveParticles = false;
			this.cameFromNonCalculatedFrame = false;
			this.cameFromNonEmissionFrame = false;
			this.playgroundCache.simulate[this.scriptedEmissionIndex] = true;
			PlaygroundParticlesC.Rebirth(this.thisInstance, this.scriptedEmissionIndex, this.internalRandom01);
			if (this.playgroundCache.lifetimeOffset.Length != this.particleCount)
			{
				return;
			}
			this.playgroundCache.initialColor[this.scriptedEmissionIndex] = this.scriptedEmissionColor;
			this.playgroundCache.lifetimeOffset[this.scriptedEmissionIndex] = 0f;
			this.playgroundCache.life[this.scriptedEmissionIndex] = 0f;
			this.playgroundCache.birth[this.scriptedEmissionIndex] = PlaygroundC.globalTime;
			if (this.scriptedLifetime == 0f)
			{
				this.playgroundCache.death[this.scriptedEmissionIndex] = this.playgroundCache.birth[this.scriptedEmissionIndex] + this.lifetime;
			}
			else
			{
				this.playgroundCache.death[this.scriptedEmissionIndex] = this.playgroundCache.birth[this.scriptedEmissionIndex] + this.scriptedLifetime;
			}
			this.playgroundCache.emission[this.scriptedEmissionIndex] = true;
			this.playgroundCache.scriptedColor[this.scriptedEmissionIndex] = giveColor;
			this.playgroundCache.isFirstLoop[this.scriptedEmissionIndex] = true;
			this.emit = true;
			this.previousEmission = true;
			this.simulationStarted = this.localTime;
			this.loopExceeded = false;
			this.loopExceededOnParticle = -1;
			this.scriptedEmissionIndex++;
			this.scriptedEmissionIndex %= this.particleCount;
		}

		// Token: 0x060008D3 RID: 2259 RVA: 0x000357B4 File Offset: 0x000339B4
		public virtual bool IsAlive()
		{
			return this.calculate && this.hasActiveParticles;
		}

		// Token: 0x060008D4 RID: 2260 RVA: 0x000357CC File Offset: 0x000339CC
		public virtual bool IsLocalSpace()
		{
			return this.localSpace;
		}

		// Token: 0x060008D5 RID: 2261 RVA: 0x000357D4 File Offset: 0x000339D4
		public virtual bool InTransition()
		{
			return this.inTransition;
		}

		// Token: 0x060008D6 RID: 2262 RVA: 0x000357DC File Offset: 0x000339DC
		public virtual bool IsLoading()
		{
			return this.isLoading;
		}

		// Token: 0x060008D7 RID: 2263 RVA: 0x000357E4 File Offset: 0x000339E4
		public virtual bool IsSaving()
		{
			return this.isSaving;
		}

		// Token: 0x060008D8 RID: 2264 RVA: 0x000357EC File Offset: 0x000339EC
		public virtual bool IsReady()
		{
			return this.initialized && !this.isPrewarming;
		}

		// Token: 0x060008D9 RID: 2265 RVA: 0x00035808 File Offset: 0x00033A08
		public virtual bool Initialized()
		{
			return this.initialized && !this.isPrewarming;
		}

		// Token: 0x060008DA RID: 2266 RVA: 0x00035824 File Offset: 0x00033A24
		public virtual bool IsYieldRefreshing()
		{
			return this.isYieldRefreshing;
		}

		// Token: 0x060008DB RID: 2267 RVA: 0x0003582C File Offset: 0x00033A2C
		public virtual bool IsSettingParticleTime()
		{
			return this.isSettingParticleTime;
		}

		// Token: 0x170000CE RID: 206
		// (get) Token: 0x060008DC RID: 2268 RVA: 0x00035834 File Offset: 0x00033A34
		// (set) Token: 0x060008DD RID: 2269 RVA: 0x0003583C File Offset: 0x00033A3C
		public bool IsDoneThread
		{
			get
			{
				return this.isDoneThread;
			}
			set
			{
				this.isDoneThread = value;
			}
		}

		// Token: 0x060008DE RID: 2270 RVA: 0x00035848 File Offset: 0x00033A48
		public virtual bool IsSkinnedWorldObjectReady()
		{
			return this.source == SOURCEC.SkinnedWorldObject && this.skinnedWorldObjectReady;
		}

		// Token: 0x060008DF RID: 2271 RVA: 0x00035860 File Offset: 0x00033A60
		public virtual bool HasTurbulence()
		{
			return this.calculate && !this.onlySourcePositioning && !this.onlyLifetimePositioning && this.turbulenceStrength > 0f && this.turbulenceType != TURBULENCETYPE.None;
		}

		// Token: 0x060008E0 RID: 2272 RVA: 0x000358B0 File Offset: 0x00033AB0
		public virtual bool HasOverflow()
		{
			return this.overflow;
		}

		// Token: 0x060008E1 RID: 2273 RVA: 0x000358B8 File Offset: 0x00033AB8
		public virtual bool HasGlobalManipulator()
		{
			return this.hasGlobalAffectingManipulators;
		}

		// Token: 0x060008E2 RID: 2274 RVA: 0x000358C0 File Offset: 0x00033AC0
		public virtual bool HasCollisionCache()
		{
			return this.hasCollisionCache;
		}

		// Token: 0x060008E3 RID: 2275 RVA: 0x000358C8 File Offset: 0x00033AC8
		public virtual bool HasCollided(int index)
		{
			return index >= 0 && index <= this.particleCount - 1 && this.hasCollisionCache && this.collisionCache.hasCollided[index];
		}

		// Token: 0x060008E4 RID: 2276 RVA: 0x000358FC File Offset: 0x00033AFC
		public virtual Vector3 GetCollisionPosition(int index)
		{
			if (!this.hasCollisionCache || index < 0 || index > this.particleCount - 1)
			{
				return Vector3.zero;
			}
			return this.collisionCache.collisionPosition[index];
		}

		// Token: 0x060008E5 RID: 2277 RVA: 0x0003593C File Offset: 0x00033B3C
		public virtual Vector3 GetCollisionNormal(int index)
		{
			if (!this.hasCollisionCache || index < 0 || index > this.particleCount - 1)
			{
				return Vector3.zero;
			}
			return this.collisionCache.collisionNormal[index];
		}

		// Token: 0x060008E6 RID: 2278 RVA: 0x0003597C File Offset: 0x00033B7C
		public virtual Vector3 GetStickyPosition(int index)
		{
			if (!this.hasCollisionCache || index < 0 || index > this.particleCount - 1)
			{
				return Vector3.zero;
			}
			return this.collisionCache.stickyPosition[index];
		}

		// Token: 0x060008E7 RID: 2279 RVA: 0x000359BC File Offset: 0x00033BBC
		public virtual void SetSticky(int index, Vector3 position, Vector3 normal, float offset, Transform parent)
		{
			if (index < 0 || index > this.particleCount - 1)
			{
				return;
			}
			if (!this.hasCollisionCache)
			{
				this.collisionCache = new CollisionCache(this.particleCount);
				this.hasCollisionCache = true;
			}
			this.collisionCache.SetSticky(index, position, normal, this.stickyCollisionsSurfaceOffset, parent);
		}

		// Token: 0x060008E8 RID: 2280 RVA: 0x00035A18 File Offset: 0x00033C18
		public virtual void UpdateSticky(int index)
		{
			if (!this.hasCollisionCache || index < 0 || index > this.particleCount - 1)
			{
				return;
			}
			this.collisionCache.hasCollided[index] = true;
			this.collisionCache.UpdateStickyPosition(index);
			this.playgroundCache.position[index] = this.collisionCache.stickyPosition[index];
			this.particleCache[index].position = this.playgroundCache.position[index];
		}

		// Token: 0x060008E9 RID: 2281 RVA: 0x00035AB4 File Offset: 0x00033CB4
		public virtual void ClearCollisions()
		{
			if (!this.hasCollisionCache)
			{
				return;
			}
			this.collisionCache.ClearCollisions();
		}

		// Token: 0x060008EA RID: 2282 RVA: 0x00035AD0 File Offset: 0x00033CD0
		public virtual void ClearCollisions(int index)
		{
			if (!this.hasCollisionCache || index < 0 || index > this.particleCount - 1)
			{
				return;
			}
			this.collisionCache.Reset(index);
		}

		// Token: 0x060008EB RID: 2283 RVA: 0x00035B00 File Offset: 0x00033D00
		public virtual Transform GetCollisionTransform(int index)
		{
			if (!this.hasCollisionCache || index < 0 || index > this.particleCount - 1)
			{
				return null;
			}
			return this.collisionCache.collisionTransform[index];
		}

		// Token: 0x060008EC RID: 2284 RVA: 0x00035B34 File Offset: 0x00033D34
		public virtual int GetLayer()
		{
			return this.thisLayer;
		}

		// Token: 0x060008ED RID: 2285 RVA: 0x00035B3C File Offset: 0x00033D3C
		public virtual void SetRandomSeed(int seed)
		{
			this.internalRandom01 = new System.Random(seed);
		}

		// Token: 0x060008EE RID: 2286 RVA: 0x00035B4C File Offset: 0x00033D4C
		public virtual bool IsReportingBadUpdateRate()
		{
			if (this.isPrewarming || this.inTransition)
			{
				return false;
			}
			this.reportUpdateStepper--;
			if (this.reportUpdateStepper == 0)
			{
				this.reportUpdateStepper = 100;
				this.isReportingBadUpdateRate = (this.localTime > 1f && this.localDeltaTime > 0.04f);
			}
			return this.isReportingBadUpdateRate;
		}

		// Token: 0x060008EF RID: 2287 RVA: 0x00035BC0 File Offset: 0x00033DC0
		public virtual float GetDeltaTime()
		{
			return this.t;
		}

		// Token: 0x170000CF RID: 207
		// (get) Token: 0x060008F0 RID: 2288 RVA: 0x00035BC8 File Offset: 0x00033DC8
		// (set) Token: 0x060008F1 RID: 2289 RVA: 0x00035BD0 File Offset: 0x00033DD0
		public float LastTimeUpdated
		{
			get
			{
				return this.lastTimeUpdated;
			}
			set
			{
				this.lastTimeUpdated = value;
			}
		}

		// Token: 0x170000D0 RID: 208
		// (get) Token: 0x060008F2 RID: 2290 RVA: 0x00035BDC File Offset: 0x00033DDC
		// (set) Token: 0x060008F3 RID: 2291 RVA: 0x00035BE4 File Offset: 0x00033DE4
		public float LocalDeltaTime
		{
			get
			{
				return this.localDeltaTime;
			}
			set
			{
				this.localDeltaTime = value;
				this.t = value;
			}
		}

		// Token: 0x060008F4 RID: 2292 RVA: 0x00035BF4 File Offset: 0x00033DF4
		public virtual SimplexNoise GetSimplex()
		{
			if (this.turbulenceSimplex == null)
			{
				this.turbulenceSimplex = new SimplexNoise();
			}
			return this.turbulenceSimplex;
		}

		// Token: 0x060008F5 RID: 2293 RVA: 0x00035C14 File Offset: 0x00033E14
		public virtual void Kill(int p)
		{
			if (p >= this.particleCount || p < 0)
			{
				return;
			}
			this.playgroundCache.changedByPropertyDeath[p] = true;
			this.playgroundCache.life[p] = this.lifetime;
			this.playgroundCache.position[p] = PlaygroundC.initialTargetPosition;
			this.particleCache[p].position = this.playgroundCache.position[p];
			this.playgroundCache.manipulatorId[p] = 0;
		}

		// Token: 0x060008F6 RID: 2294 RVA: 0x00035CA8 File Offset: 0x00033EA8
		public virtual void KillAndSendManipulatorDeathEvents(int p)
		{
			if (p >= this.particleCount || p < 0)
			{
				return;
			}
			this.playgroundCache.changedByPropertyDeath[p] = true;
			this.playgroundCache.life[p] = this.lifetime;
			this.playgroundCache.position[p] = PlaygroundC.initialTargetPosition;
			this.particleCache[p].position = this.playgroundCache.position[p];
			if (this.playgroundCache.manipulatorId[p] != 0)
			{
				for (int i = 0; i < this.manipulators.Count; i++)
				{
					if (this.manipulators[i].trackParticles && this.manipulators[i].ContainsParticle(this.particleSystemId, p))
					{
						this.playgroundCache.manipulatorId[p] = 0;
						this.manipulators[i].RemoveParticle(this.particleSystemId, p);
						if (this.manipulators[i].sendEventExit)
						{
							this.UpdateEventParticle(this.manipulators[i].manipulatorEventParticle, p);
							this.manipulators[i].SendParticleEventDeath();
						}
					}
				}
				if (this.playgroundCache.manipulatorId[p] != 0)
				{
					for (int j = 0; j < PlaygroundC.reference.manipulators.Count; j++)
					{
						if (PlaygroundC.reference.manipulators[j].trackParticles && PlaygroundC.reference.manipulators[j].ContainsParticle(this.particleSystemId, p))
						{
							PlaygroundC.reference.manipulators[j].RemoveParticle(this.particleSystemId, p);
							if (PlaygroundC.reference.manipulators[j].sendEventExit)
							{
								this.UpdateEventParticle(PlaygroundC.reference.manipulators[j].manipulatorEventParticle, p);
								PlaygroundC.reference.manipulators[j].SendParticleEventDeath();
							}
						}
					}
				}
				this.playgroundCache.manipulatorId[p] = 0;
			}
		}

		// Token: 0x060008F7 RID: 2295 RVA: 0x00035ED8 File Offset: 0x000340D8
		public virtual void SetNoForce(int p, bool noForce)
		{
			this.playgroundCache.noForce[p] = noForce;
		}

		// Token: 0x060008F8 RID: 2296 RVA: 0x00035EE8 File Offset: 0x000340E8
		public virtual bool NoForce(int p)
		{
			return this.playgroundCache.noForce[p];
		}

		// Token: 0x060008F9 RID: 2297 RVA: 0x00035EF8 File Offset: 0x000340F8
		public virtual void Translate(int p, Vector3 translation)
		{
			p = Mathf.Clamp(p, 0, this.playgroundCache.position.Length);
			this.playgroundCache.position[p] += translation;
			this.particleCache[p].position = this.playgroundCache.position[p];
			this.playgroundCache.isCalculatedThisFrame[p] = true;
		}

		// Token: 0x060008FA RID: 2298 RVA: 0x00035F74 File Offset: 0x00034174
		public virtual void ParticlePosition(int p, Vector3 position)
		{
			p = Mathf.Clamp(p, 0, this.playgroundCache.position.Length);
			this.playgroundCache.position[p] = position;
			this.particleCache[p].position = position;
			this.playgroundCache.previousParticlePosition[p] = position;
			this.playgroundCache.isCalculatedThisFrame[p] = true;
		}

		// Token: 0x060008FB RID: 2299 RVA: 0x00035FE8 File Offset: 0x000341E8
		public virtual void ParticleColor(int p, Color32 color)
		{
			p = Mathf.Clamp(p, 0, this.playgroundCache.color.Length);
			this.playgroundCache.changedByPropertyColor[p] = true;
			this.playgroundCache.color[p] = color;
			this.SetParticleColorInternal(p, this.playgroundCache.color[p]);
		}

		// Token: 0x060008FC RID: 2300 RVA: 0x00036050 File Offset: 0x00034250
		public virtual void SetParticleColorInternal(int index, Color32 color)
		{
			this.particleCache[index].startColor = color;
		}

		// Token: 0x060008FD RID: 2301 RVA: 0x00036064 File Offset: 0x00034264
		public virtual Color32 GetParticleColorInternal(int index)
		{
			return this.particleCache[index].startColor;
		}

		// Token: 0x060008FE RID: 2302 RVA: 0x00036078 File Offset: 0x00034278
		public virtual void ParticleSize(int p, float size)
		{
			p = Mathf.Clamp(p, 0, this.playgroundCache.size.Length);
			this.playgroundCache.changedByPropertySize[p] = true;
			this.playgroundCache.size[p] = size;
			this.particleCache[p].startSize = size;
		}

		// Token: 0x060008FF RID: 2303 RVA: 0x000360CC File Offset: 0x000342CC
		public virtual void ParticleVelocity(int p, Vector3 velocity)
		{
			p = Mathf.Clamp(p, 0, this.playgroundCache.velocity.Length);
			this.playgroundCache.velocity[p] = velocity;
		}

		// Token: 0x06000900 RID: 2304 RVA: 0x000360FC File Offset: 0x000342FC
		public virtual void PositionToTransformPoint(int p, Vector3 position, Transform targetTransform)
		{
			this.playgroundCache.position[p] = targetTransform.TransformPoint(position);
		}

		// Token: 0x06000901 RID: 2305 RVA: 0x0003611C File Offset: 0x0003431C
		public virtual void PositionToInverseTransformPoint(int p, Vector3 position, Transform targetTransform)
		{
			this.playgroundCache.position[p] = targetTransform.InverseTransformPoint(position);
		}

		// Token: 0x06000902 RID: 2306 RVA: 0x0003613C File Offset: 0x0003433C
		public virtual Vector3 GetParticlePosition(int p)
		{
			return this.playgroundCache.position[p];
		}

		// Token: 0x06000903 RID: 2307 RVA: 0x00036154 File Offset: 0x00034354
		public virtual Vector3 GetSourcePosition(int p)
		{
			return this.playgroundCache.targetPosition[p];
		}

		// Token: 0x06000904 RID: 2308 RVA: 0x0003616C File Offset: 0x0003436C
		public virtual void SetHasActiveParticles()
		{
			this.hasActiveParticles = true;
			this.threadHadNoActiveParticles = false;
		}

		// Token: 0x06000905 RID: 2309 RVA: 0x0003617C File Offset: 0x0003437C
		public virtual bool HasSeveralManipulatorEvents()
		{
			return this.hasSeveralManipulatorEvents;
		}

		// Token: 0x06000906 RID: 2310 RVA: 0x00036184 File Offset: 0x00034384
		public virtual void ProtectParticleFromManipulator(int particle, ManipulatorObjectC manipulator)
		{
			if (manipulator.transform.Update())
			{
				this.playgroundCache.excludeFromManipulatorId[particle] = manipulator.transform.instanceID;
			}
		}

		// Token: 0x06000907 RID: 2311 RVA: 0x000361B0 File Offset: 0x000343B0
		public virtual void RemoveParticleProtection(int particle)
		{
			this.playgroundCache.excludeFromManipulatorId[particle] = 0;
		}

		// Token: 0x06000908 RID: 2312 RVA: 0x000361C0 File Offset: 0x000343C0
		public virtual bool IsSettingLifetime()
		{
			return this.isSettingLifetime;
		}

		// Token: 0x06000909 RID: 2313 RVA: 0x000361C8 File Offset: 0x000343C8
		public virtual bool IsPrewarming()
		{
			return this.isPrewarming;
		}

		// Token: 0x0600090A RID: 2314 RVA: 0x000361D0 File Offset: 0x000343D0
		public virtual bool IsParticleInsideManipulator(int particleId, ManipulatorObjectC manipulator)
		{
			return manipulator.Contains(this.playgroundCache.position[particleId], (!this.localSpace) ? manipulator.transform.position : manipulator.transform.localPosition);
		}

		// Token: 0x0600090B RID: 2315 RVA: 0x00036220 File Offset: 0x00034420
		public virtual int GetSplineIndex()
		{
			return this.splineIndex;
		}

		// Token: 0x0600090C RID: 2316 RVA: 0x00036228 File Offset: 0x00034428
		public virtual int GetTransformIndex()
		{
			return this.transformIndex;
		}

		// Token: 0x0600090D RID: 2317 RVA: 0x00036230 File Offset: 0x00034430
		public virtual void RefreshMaskSorting()
		{
			this.playgroundCache.maskSorting = new int[this.particleCount];
			switch (this.particleMaskSorting)
			{
			case MASKSORTINGC.Linear:
				for (int i = 0; i < this.playgroundCache.maskSorting.Length; i++)
				{
					this.playgroundCache.maskSorting[i] = i;
				}
				break;
			case MASKSORTINGC.Reversed:
				for (int j = 0; j < this.playgroundCache.maskSorting.Length; j++)
				{
					this.playgroundCache.maskSorting[j] = this.playgroundCache.maskSorting.Length - 1 - j;
				}
				break;
			case MASKSORTINGC.Scrambled:
				for (int k = 0; k < this.playgroundCache.maskSorting.Length; k++)
				{
					this.playgroundCache.maskSorting[k] = (this.playgroundCache.maskSorting[k] = k);
				}
				PlaygroundC.ShuffleArray(this.playgroundCache.maskSorting);
				break;
			}
			this.previousMaskSorting = this.particleMaskSorting;
		}

		// Token: 0x0600090E RID: 2318 RVA: 0x00036344 File Offset: 0x00034544
		public virtual void RefreshMaskSorting(int[] maskSortingArray)
		{
			this.playgroundCache.maskSorting = new int[this.particleCount];
			for (int i = 0; i < this.particleCount; i++)
			{
				if (i < maskSortingArray.Length)
				{
					this.playgroundCache.maskSorting[i] = maskSortingArray[i];
				}
				else
				{
					this.playgroundCache.maskSorting[i] = i;
				}
			}
			this.previousMaskSorting = this.particleMaskSorting;
		}

		// Token: 0x0600090F RID: 2319 RVA: 0x000363B8 File Offset: 0x000345B8
		public static PlaygroundParticlesC CreatePlaygroundParticles(Texture2D[] images, string name, Vector3 position, Quaternion rotation, Vector3 offset, float particleSize, float scale, Material material)
		{
			PlaygroundParticlesC playgroundParticlesC = PlaygroundParticlesC.CreateParticleObject(name, position, rotation, particleSize, material);
			int[] array = new int[images.Length];
			for (int i = 0; i < images.Length; i++)
			{
				array[i] = images[i].width * images[i].height;
			}
			playgroundParticlesC.particleCache = new ParticleSystem.Particle[array[PlaygroundC.Largest(array)]];
			PlaygroundParticlesC.OnCreatePlaygroundParticles(playgroundParticlesC);
			for (int i = 0; i < images.Length; i++)
			{
				playgroundParticlesC.states.Add(new ParticleStateC());
				playgroundParticlesC.states[playgroundParticlesC.states.Count - 1].ConstructParticles(images[i], scale, offset, "State 0", null);
			}
			return playgroundParticlesC;
		}

		// Token: 0x06000910 RID: 2320 RVA: 0x0003646C File Offset: 0x0003466C
		public static void OnCreatePlaygroundParticles(PlaygroundParticlesC playgroundParticles)
		{
			playgroundParticles.playgroundCache = new PlaygroundCache();
			playgroundParticles.paint = new PaintObjectC();
			playgroundParticles.states = new List<ParticleStateC>();
			playgroundParticles.projection = new ParticleProjectionC();
			playgroundParticles.colliders = new List<PlaygroundColliderC>();
			playgroundParticles.particleSystemId = PlaygroundC.particlesQuantity - 1;
			playgroundParticles.projection.projectionTransform = playgroundParticles.particleSystemTransform;
			playgroundParticles.playgroundCache.initialSize = new float[playgroundParticles.particleCount];
			playgroundParticles.playgroundCache.initialSize = PlaygroundParticlesC.RandomFloat(playgroundParticles.playgroundCache.initialSize.Length, playgroundParticles.sizeMin, playgroundParticles.sizeMax, playgroundParticles.internalRandom01);
			playgroundParticles.previousParticleCount = playgroundParticles.particleCount;
			playgroundParticles.lifetimeSize = new AnimationCurve(new Keyframe[]
			{
				new Keyframe(0f, 1f),
				new Keyframe(1f, 1f)
			});
			playgroundParticles.shurikenParticleSystem.Emit(playgroundParticles.particleCount);
			playgroundParticles.shurikenParticleSystem.GetParticles(playgroundParticles.particleCache);
			for (int i = 0; i < playgroundParticles.particleCache.Length; i++)
			{
				playgroundParticles.playgroundCache.size[i] = playgroundParticles.playgroundCache.initialSize[i];
			}
			PlaygroundParticlesC.SetParticleCount(playgroundParticles, playgroundParticles.particleCount);
			if (PlaygroundC.reference != null)
			{
				PlaygroundC.particlesQuantity++;
				PlaygroundC.reference.particleSystems.Add(playgroundParticles);
				playgroundParticles.particleSystemId = PlaygroundC.particlesQuantity - 1;
			}
		}

		// Token: 0x06000911 RID: 2321 RVA: 0x00036604 File Offset: 0x00034804
		public static PlaygroundParticlesC CreateParticleObject(string name, Vector3 position, Quaternion rotation, float particleSize, Material material)
		{
			GameObject gameObject = PlaygroundC.ResourceInstantiate("Particle Playground System");
			PlaygroundParticlesC component = gameObject.GetComponent<PlaygroundParticlesC>();
			component.particleSystemGameObject = gameObject;
			component.particleSystemGameObject.name = name;
			component.shurikenParticleSystem = component.particleSystemGameObject.GetComponent<ParticleSystem>();
			component.particleSystemRenderer = component.shurikenParticleSystem.GetComponent<Renderer>();
			component.particleSystemRenderer2 = (component.shurikenParticleSystem.GetComponent<Renderer>() as ParticleSystemRenderer);
			component.particleSystemTransform = component.particleSystemGameObject.transform;
			component.sourceTransform = component.particleSystemTransform;
			component.source = SOURCEC.Transform;
			component.particleSystemTransform.position = position;
			component.particleSystemTransform.rotation = rotation;
			if (PlaygroundC.reference.autoGroup && component.particleSystemTransform.parent == null)
			{
				component.particleSystemTransform.parent = PlaygroundC.referenceTransform;
			}
			if (component.particleSystemRenderer.sharedMaterial == null)
			{
				component.particleSystemRenderer.sharedMaterial = material;
			}
			return component;
		}

		// Token: 0x06000912 RID: 2322 RVA: 0x00036704 File Offset: 0x00034904
		public static WorldObject NewWorldObject(Transform meshTransform)
		{
			WorldObject worldObject = new WorldObject();
			if (meshTransform.GetComponentInChildren<MeshFilter>())
			{
				worldObject.transform = meshTransform;
				worldObject.Initialize();
			}
			else
			{
				global::Debug.Log("Could not find a mesh in " + meshTransform.name + ".");
			}
			return worldObject;
		}

		// Token: 0x06000913 RID: 2323 RVA: 0x00036754 File Offset: 0x00034954
		public static SkinnedWorldObject NewSkinnedWorldObject(Transform meshTransform)
		{
			SkinnedWorldObject skinnedWorldObject = new SkinnedWorldObject();
			if (meshTransform.GetComponentInChildren<SkinnedMeshRenderer>())
			{
				skinnedWorldObject.transform = meshTransform;
				skinnedWorldObject.Initialize();
			}
			else
			{
				global::Debug.Log("Could not find a skinned mesh in " + meshTransform.name + ".");
			}
			return skinnedWorldObject;
		}

		// Token: 0x06000914 RID: 2324 RVA: 0x000367A4 File Offset: 0x000349A4
		public static SkinnedWorldObject NewSkinnedWorldObject(Transform meshTransform, int downResolution)
		{
			SkinnedWorldObject skinnedWorldObject = PlaygroundParticlesC.NewSkinnedWorldObject(meshTransform);
			skinnedWorldObject.downResolution = downResolution;
			return skinnedWorldObject;
		}

		// Token: 0x06000915 RID: 2325 RVA: 0x000367C0 File Offset: 0x000349C0
		public static PaintObjectC NewPaintObject(PlaygroundParticlesC playgroundParticles)
		{
			PaintObjectC result = new PaintObjectC();
			playgroundParticles.paint = result;
			playgroundParticles.paint.Initialize();
			return result;
		}

		// Token: 0x06000916 RID: 2326 RVA: 0x000367E8 File Offset: 0x000349E8
		public static ParticleProjectionC NewProjectionObject(PlaygroundParticlesC playgroundParticles)
		{
			ParticleProjectionC result = new ParticleProjectionC();
			playgroundParticles.projection = result;
			playgroundParticles.projection.Initialize();
			return result;
		}

		// Token: 0x06000917 RID: 2327 RVA: 0x00036810 File Offset: 0x00034A10
		public static ManipulatorObjectC NewManipulatorObject(MANIPULATORTYPEC type, LayerMask affects, Transform manipulatorTransform, float size, float strength, PlaygroundParticlesC playgroundParticles)
		{
			ManipulatorObjectC manipulatorObjectC = new ManipulatorObjectC();
			manipulatorObjectC.type = type;
			manipulatorObjectC.affects = affects;
			manipulatorObjectC.transform.transform = manipulatorTransform;
			manipulatorObjectC.size = size;
			manipulatorObjectC.strength = strength;
			manipulatorObjectC.bounds = new Bounds(Vector3.zero, new Vector3(size, size, size));
			manipulatorObjectC.property = new ManipulatorPropertyC();
			manipulatorObjectC.Update();
			if (playgroundParticles == null)
			{
				PlaygroundC.reference.manipulators.Add(manipulatorObjectC);
			}
			else
			{
				playgroundParticles.manipulators.Add(manipulatorObjectC);
			}
			return manipulatorObjectC;
		}

		// Token: 0x06000918 RID: 2328 RVA: 0x000368A8 File Offset: 0x00034AA8
		public static void GetPosition(SkinnedWorldObject particleStateWorldObject, bool updateNormals)
		{
			if (updateNormals)
			{
				particleStateWorldObject.normals = particleStateWorldObject.mesh.normals;
			}
			Vector3[] vertices = particleStateWorldObject.mesh.vertices;
			BoneWeight[] weights = particleStateWorldObject.mesh.boneWeights;
			Matrix4x4[] bindposes = particleStateWorldObject.mesh.bindposes;
			Matrix4x4[] boneMatrices = new Matrix4x4[particleStateWorldObject.renderer.bones.Length];
			int i;
			for (i = 0; i < boneMatrices.Length; i++)
			{
				boneMatrices[i] = particleStateWorldObject.renderer.bones[i].localToWorldMatrix * bindposes[i];
			}
			PlaygroundC.RunAsync(delegate()
			{
				Matrix4x4 matrix4x = default(Matrix4x4);
				for ( i = 0; i < vertices.Length; i++)
				{
					BoneWeight boneWeight = weights[i];
					Matrix4x4 matrix4x2 = boneMatrices[boneWeight.boneIndex0];
					Matrix4x4 matrix4x3 = boneMatrices[boneWeight.boneIndex1];
					Matrix4x4 matrix4x4 = boneMatrices[boneWeight.boneIndex2];
					Matrix4x4 matrix4x5 = boneMatrices[boneWeight.boneIndex3];
					for (i = 0; i < 16; i++)
					{
						matrix4x[i] = matrix4x2[i] * boneWeight.weight0 + matrix4x3[i] * boneWeight.weight1 + matrix4x4[i] * boneWeight.weight2 + matrix4x5[i] * boneWeight.weight3;
					}
					vertices[i] = matrix4x.MultiplyPoint3x4(vertices[i]);
				}
				particleStateWorldObject.vertexPositions = vertices;
			});
		}

		// Token: 0x06000919 RID: 2329 RVA: 0x000369C4 File Offset: 0x00034BC4
		public static void GetPosition(Vector3[] v3, WorldObject particleStateWorldObject)
		{
			if (particleStateWorldObject.meshFilter.sharedMesh != particleStateWorldObject.mesh)
			{
				particleStateWorldObject.mesh = particleStateWorldObject.meshFilter.sharedMesh;
			}
			v3 = particleStateWorldObject.mesh.vertices;
		}

		// Token: 0x0600091A RID: 2330 RVA: 0x00036A00 File Offset: 0x00034C00
		public static void GetProceduralPosition(Vector3[] v3, WorldObject particleStateWorldObject)
		{
			if (particleStateWorldObject.meshFilter.sharedMesh != particleStateWorldObject.mesh)
			{
				particleStateWorldObject.mesh = particleStateWorldObject.meshFilter.sharedMesh;
			}
			Vector3[] vertices = particleStateWorldObject.mesh.vertices;
			if (v3.Length != vertices.Length)
			{
				v3 = new Vector3[vertices.Length];
			}
			for (int i = 0; i < v3.Length; i++)
			{
				v3[i] = particleStateWorldObject.transform.TransformPoint(vertices[i % vertices.Length]);
			}
		}

		// Token: 0x0600091B RID: 2331 RVA: 0x00036A98 File Offset: 0x00034C98
		public static void GetNormals(Vector3[] v3, WorldObject particleStateWorldObject)
		{
			v3 = particleStateWorldObject.mesh.normals;
		}

		// Token: 0x0600091C RID: 2332 RVA: 0x00036AA8 File Offset: 0x00034CA8
		public static void SetSize(PlaygroundParticlesC playgroundParticles, float size)
		{
			for (int i = 0; i < playgroundParticles.particleCache.Length; i++)
			{
				playgroundParticles.playgroundCache.initialSize[i] = size;
				playgroundParticles.particleCache[i].startSize = size;
			}
		}

		// Token: 0x0600091D RID: 2333 RVA: 0x00036AF0 File Offset: 0x00034CF0
		public virtual void RefreshSystemRandom()
		{
			this.internalRandom01 = new System.Random();
		}

		// Token: 0x0600091E RID: 2334 RVA: 0x00036B00 File Offset: 0x00034D00
		public static void SetSizeRandom(PlaygroundParticlesC playgroundParticles, float sizeMinimum, float sizeMaximum)
		{
			playgroundParticles.playgroundCache.initialSize = PlaygroundParticlesC.RandomFloat(playgroundParticles.particleCache.Length, sizeMinimum, sizeMaximum, playgroundParticles.internalRandom01);
			playgroundParticles.sizeMin = sizeMinimum;
			playgroundParticles.sizeMax = sizeMaximum;
			playgroundParticles.previousSizeMin = playgroundParticles.sizeMin;
			playgroundParticles.previousSizeMax = playgroundParticles.sizeMax;
		}

		// Token: 0x0600091F RID: 2335 RVA: 0x00036B54 File Offset: 0x00034D54
		public static void SetRotationRandom(PlaygroundParticlesC playgroundParticles, float rotationMinimum, float rotationMaximum)
		{
			playgroundParticles.playgroundCache.rotationSpeed = PlaygroundParticlesC.RandomFloat(playgroundParticles.particleCache.Length, rotationMinimum, rotationMaximum, playgroundParticles.internalRandom01);
			for (int i = 0; i < playgroundParticles.particleCache.Length; i++)
			{
				playgroundParticles.playgroundCache.rotation[i] = playgroundParticles.playgroundCache.initialRotation[i];
			}
			playgroundParticles.rotationSpeedMin = rotationMinimum;
			playgroundParticles.rotationSpeedMax = rotationMaximum;
			playgroundParticles.previousRotationSpeedMin = playgroundParticles.rotationSpeedMin;
			playgroundParticles.previousRotationSpeedMax = playgroundParticles.rotationSpeedMax;
		}

		// Token: 0x06000920 RID: 2336 RVA: 0x00036BDC File Offset: 0x00034DDC
		public static void SetInitialRotationRandom(PlaygroundParticlesC playgroundParticles, float rotationMinimum, float rotationMaximum)
		{
			playgroundParticles.playgroundCache.initialRotation = PlaygroundParticlesC.RandomFloat(playgroundParticles.particleCache.Length, rotationMinimum, rotationMaximum, playgroundParticles.internalRandom01);
			for (int i = 0; i < playgroundParticles.particleCache.Length; i++)
			{
				playgroundParticles.playgroundCache.rotation[i] = playgroundParticles.playgroundCache.initialRotation[i];
			}
			playgroundParticles.initialRotationMin = rotationMinimum;
			playgroundParticles.initialRotationMax = rotationMaximum;
			playgroundParticles.previousInitialRotationMin = playgroundParticles.initialRotationMin;
			playgroundParticles.previousInitialRotationMax = playgroundParticles.initialRotationMax;
		}

		// Token: 0x06000921 RID: 2337 RVA: 0x00036C64 File Offset: 0x00034E64
		public static void SetVelocityRandom(PlaygroundParticlesC playgroundParticles, Vector3 velocityMinimum, Vector3 velocityMaximum)
		{
			playgroundParticles.playgroundCache.initialVelocity = new Vector3[playgroundParticles.particleCount];
			for (int i = 0; i < playgroundParticles.particleCount; i++)
			{
				if (playgroundParticles.initialVelocityMethod == MINMAXVECTOR3METHOD.Spherical)
				{
					playgroundParticles.playgroundCache.initialVelocity[i] = PlaygroundParticlesC.RandomRangeSpherical(playgroundParticles.internalRandom01, velocityMinimum.x, velocityMaximum.x);
				}
				else if (playgroundParticles.initialVelocityMethod == MINMAXVECTOR3METHOD.SphericalLinear)
				{
					playgroundParticles.playgroundCache.initialVelocity[i] = PlaygroundParticlesC.RandomRangeSpherical(playgroundParticles.internalRandom01, velocityMinimum.x, velocityMaximum.x, (float)i * 1f / ((float)playgroundParticles.particleCount * 1f));
				}
				else if (playgroundParticles.initialVelocityMethod == MINMAXVECTOR3METHOD.RectangularLinear)
				{
					playgroundParticles.playgroundCache.initialVelocity[i] = Vector3.Lerp(velocityMinimum, velocityMaximum, (float)i * 1f / ((float)playgroundParticles.particleCount * 1f));
				}
				else
				{
					playgroundParticles.playgroundCache.initialVelocity[i] = PlaygroundParticlesC.RandomRange(playgroundParticles.internalRandom01, velocityMinimum, velocityMaximum);
				}
			}
			playgroundParticles.initialVelocityMin = velocityMinimum;
			playgroundParticles.initialVelocityMax = velocityMaximum;
			playgroundParticles.previousVelocityMin = playgroundParticles.initialVelocityMin;
			playgroundParticles.previousVelocityMax = playgroundParticles.initialVelocityMax;
			playgroundParticles.previousVelocityMethod = playgroundParticles.initialVelocityMethod;
		}

		// Token: 0x06000922 RID: 2338 RVA: 0x00036DD0 File Offset: 0x00034FD0
		public static void SetLocalVelocityRandom(PlaygroundParticlesC playgroundParticles, Vector3 velocityMinimum, Vector3 velocityMaximum)
		{
			playgroundParticles.playgroundCache.initialLocalVelocity = new Vector3[playgroundParticles.particleCount];
			for (int i = 0; i < playgroundParticles.particleCount; i++)
			{
				if (playgroundParticles.initialLocalVelocityMethod == MINMAXVECTOR3METHOD.Spherical)
				{
					playgroundParticles.playgroundCache.initialLocalVelocity[i] = PlaygroundParticlesC.RandomRangeSpherical(playgroundParticles.internalRandom01, velocityMinimum.x, velocityMaximum.x);
				}
				else if (playgroundParticles.initialLocalVelocityMethod == MINMAXVECTOR3METHOD.SphericalLinear)
				{
					playgroundParticles.playgroundCache.initialLocalVelocity[i] = PlaygroundParticlesC.RandomRangeSpherical(playgroundParticles.internalRandom01, velocityMinimum.x, velocityMaximum.x, (float)i * 1f / ((float)playgroundParticles.particleCount * 1f));
				}
				else if (playgroundParticles.initialLocalVelocityMethod == MINMAXVECTOR3METHOD.RectangularLinear)
				{
					playgroundParticles.playgroundCache.initialLocalVelocity[i] = Vector3.Lerp(velocityMinimum, velocityMaximum, (float)i * 1f / ((float)playgroundParticles.particleCount * 1f));
				}
				else
				{
					playgroundParticles.playgroundCache.initialLocalVelocity[i] = PlaygroundParticlesC.RandomRange(playgroundParticles.internalRandom01, velocityMinimum, velocityMaximum);
				}
			}
			playgroundParticles.initialLocalVelocityMin = velocityMinimum;
			playgroundParticles.initialLocalVelocityMax = velocityMaximum;
			playgroundParticles.previousLocalVelocityMin = playgroundParticles.initialLocalVelocityMin;
			playgroundParticles.previousLocalVelocityMax = playgroundParticles.initialLocalVelocityMax;
			playgroundParticles.previousLocalVelocityMethod = playgroundParticles.initialLocalVelocityMethod;
		}

		// Token: 0x06000923 RID: 2339 RVA: 0x00036F3C File Offset: 0x0003513C
		public static void SetMaterial(PlaygroundParticlesC playgroundParticles, Material particleMaterial)
		{
			playgroundParticles.particleSystemRenderer.sharedMaterial = particleMaterial;
		}

		// Token: 0x06000924 RID: 2340 RVA: 0x00036F4C File Offset: 0x0003514C
		public static void SetAlpha(PlaygroundParticlesC playgroundParticles, float alpha)
		{
			for (int i = 0; i < playgroundParticles.particleCache.Length; i++)
			{
				Color c = playgroundParticles.GetParticleColorInternal(i);
				c.a = alpha;
				playgroundParticles.SetParticleColorInternal(i, c);
			}
		}

		// Token: 0x06000925 RID: 2341 RVA: 0x00036F94 File Offset: 0x00035194
		public static void Translate(PlaygroundParticlesC playgroundParticles, Vector3 direction)
		{
			for (int i = 0; i < playgroundParticles.particleCache.Length; i++)
			{
				ParticleSystem.Particle[] array = playgroundParticles.particleCache;
				int num = i;
				array[num].position = array[num].position + direction;
			}
		}

		// Token: 0x06000926 RID: 2342 RVA: 0x00036FD8 File Offset: 0x000351D8
		public static void Add(PlaygroundParticlesC playgroundParticles, ParticleStateC state)
		{
			playgroundParticles.states.Add(state);
			state.Initialize();
		}

		// Token: 0x06000927 RID: 2343 RVA: 0x00036FEC File Offset: 0x000351EC
		public static void Add(PlaygroundParticlesC playgroundParticles, Texture2D image, float scale, Vector3 offset, string stateName, Transform stateTransform)
		{
			playgroundParticles.states.Add(new ParticleStateC());
			playgroundParticles.states[playgroundParticles.states.Count - 1].ConstructParticles(image, scale, offset, stateName, stateTransform);
		}

		// Token: 0x06000928 RID: 2344 RVA: 0x00037024 File Offset: 0x00035224
		public static void Add(PlaygroundParticlesC playgroundParticles, Texture2D image, Texture2D depthmap, float depthmapStrength, float scale, Vector3 offset, string stateName, Transform stateTransform)
		{
			playgroundParticles.states.Add(new ParticleStateC());
			playgroundParticles.states[playgroundParticles.states.Count - 1].ConstructParticles(image, scale, offset, stateName, stateTransform);
			playgroundParticles.states[playgroundParticles.states.Count - 1].stateDepthmap = depthmap;
			playgroundParticles.states[playgroundParticles.states.Count - 1].stateDepthmapStrength = depthmapStrength;
		}

		// Token: 0x06000929 RID: 2345 RVA: 0x000370A4 File Offset: 0x000352A4
		public static void Destroy(PlaygroundParticlesC playgroundParticles)
		{
			PlaygroundParticlesC.Clear(playgroundParticles);
			UnityEngine.Object.DestroyImmediate(playgroundParticles.particleSystemGameObject);
			playgroundParticles = null;
		}

		// Token: 0x0600092A RID: 2346 RVA: 0x000370BC File Offset: 0x000352BC
		public static void SetLifetime(PlaygroundParticlesC playgroundParticles, SORTINGC sorting, float time)
		{
			if (!playgroundParticles.enabled)
			{
				return;
			}
			if (playgroundParticles.isSettingLifetime || playgroundParticles.isSettingParticleCount)
			{
				return;
			}
			if (playgroundParticles.internalRandom01 == null)
			{
				playgroundParticles.RefreshSystemRandom();
			}
			playgroundParticles.isSettingLifetime = true;
			if (playgroundParticles.multithreadedStartup)
			{
				PlaygroundC.RunAsync(delegate()
				{
					PlaygroundParticlesC.SetLifetimeAsyncFriendly(playgroundParticles, sorting, time);
				});
			}
			else
			{
				PlaygroundParticlesC.SetLifetimeAsyncFriendly(playgroundParticles, sorting, time);
			}
		}

		// Token: 0x0600092B RID: 2347 RVA: 0x0003717C File Offset: 0x0003537C
		public static void SetLifetimeAsyncFriendly(PlaygroundParticlesC playgroundParticles, SORTINGC sorting, float time)
		{
			playgroundParticles.lifetime = time;
			PlaygroundParticlesC.SetLifetimeSubtraction(playgroundParticles);
			playgroundParticles.playgroundCache.lifetimeOffset = new float[playgroundParticles.particleCount];
			int num = playgroundParticles.playgroundCache.lifetimeOffset.Length;
			if (playgroundParticles.source != SOURCEC.Script)
			{
				float num2 = playgroundParticles.lifetimeEmission;
				if (!playgroundParticles.loop)
				{
					num2 *= 0.95f;
				}
				switch (sorting)
				{
				case SORTINGC.Scrambled:
					for (int i = 0; i < playgroundParticles.particleCount; i++)
					{
						if (num != playgroundParticles.playgroundCache.lifetimeOffset.Length)
						{
							playgroundParticles.isSettingLifetime = false;
							return;
						}
						playgroundParticles.playgroundCache.lifetimeOffset[i] = PlaygroundParticlesC.RandomRange(playgroundParticles.internalRandom01, 0f, playgroundParticles.lifetime * num2);
					}
					break;
				case SORTINGC.ScrambledLinear:
					for (int j = 0; j < playgroundParticles.particleCount; j++)
					{
						if (num != playgroundParticles.playgroundCache.lifetimeOffset.Length)
						{
							playgroundParticles.isSettingLifetime = false;
							return;
						}
						float num3 = (float)j * 1f / ((float)playgroundParticles.particleCount * 1f);
						playgroundParticles.playgroundCache.lifetimeOffset[j] = playgroundParticles.lifetime * num2 * num3;
					}
					for (int k = playgroundParticles.playgroundCache.lifetimeOffset.Length - 1; k > 0; k--)
					{
						if (num != playgroundParticles.playgroundCache.lifetimeOffset.Length)
						{
							playgroundParticles.isSettingLifetime = false;
							return;
						}
						int num4 = playgroundParticles.internalRandom01.Next(0, k);
						float num5 = playgroundParticles.playgroundCache.lifetimeOffset[k];
						playgroundParticles.playgroundCache.lifetimeOffset[k] = playgroundParticles.playgroundCache.lifetimeOffset[num4];
						playgroundParticles.playgroundCache.lifetimeOffset[num4] = num5;
					}
					break;
				case SORTINGC.Linear:
					for (int l = 0; l < playgroundParticles.particleCount; l++)
					{
						if (num != playgroundParticles.playgroundCache.lifetimeOffset.Length)
						{
							playgroundParticles.isSettingLifetime = false;
							return;
						}
						float num6 = (float)l * 1f / ((float)playgroundParticles.particleCount * 1f);
						playgroundParticles.playgroundCache.lifetimeOffset[l] = playgroundParticles.lifetime * num2 * num6;
					}
					break;
				case SORTINGC.Reversed:
				{
					int num7 = 0;
					for (int m = playgroundParticles.particleCount - 1; m >= 0; m--)
					{
						if (num != playgroundParticles.playgroundCache.lifetimeOffset.Length)
						{
							playgroundParticles.isSettingLifetime = false;
							return;
						}
						float num8 = (float)num7 * 1f / ((float)playgroundParticles.particleCount * 1f);
						num7++;
						playgroundParticles.playgroundCache.lifetimeOffset[m] = playgroundParticles.lifetime * num2 * num8;
					}
					break;
				}
				case SORTINGC.NearestNeighbor:
				{
					playgroundParticles.nearestNeighborOrigin = Mathf.Clamp(playgroundParticles.nearestNeighborOrigin, 0, playgroundParticles.particleCount - 1);
					float[] array = new float[playgroundParticles.particleCount];
					float num9 = 0f;
					Vector3 a = Vector3.zero;
					switch (playgroundParticles.nearestNeighborOriginMethod)
					{
					case NEARESTNEIGHBORORIGINMETHOD.SourcePoint:
						a = playgroundParticles.playgroundCache.targetPosition[playgroundParticles.nearestNeighborOrigin % playgroundParticles.particleCount];
						break;
					case NEARESTNEIGHBORORIGINMETHOD.Vector3:
						a = playgroundParticles.nearestNeighborOriginVector3;
						break;
					case NEARESTNEIGHBORORIGINMETHOD.Transform:
						a = playgroundParticles.nearestNeighborOriginTransformPosition;
						break;
					}
					for (int n = 0; n < playgroundParticles.particleCount; n++)
					{
						if (num != playgroundParticles.playgroundCache.lifetimeOffset.Length)
						{
							playgroundParticles.isSettingLifetime = false;
							return;
						}
						array[n % playgroundParticles.particleCount] = Vector3.SqrMagnitude(a - playgroundParticles.playgroundCache.targetPosition[n % playgroundParticles.particleCount]);
						if (array[n % playgroundParticles.particleCount] > num9)
						{
							num9 = array[n % playgroundParticles.particleCount];
						}
					}
					if (num9 > 0f)
					{
						for (int num10 = 0; num10 < playgroundParticles.particleCount; num10++)
						{
							if (num != playgroundParticles.playgroundCache.lifetimeOffset.Length)
							{
								playgroundParticles.isSettingLifetime = false;
								return;
							}
							playgroundParticles.playgroundCache.lifetimeOffset[num10 % playgroundParticles.particleCount] = Mathf.Lerp(0f, playgroundParticles.lifetime * (num2 - 0.001f), array[num10 % playgroundParticles.particleCount] / num9);
						}
					}
					else
					{
						for (int num11 = 0; num11 < playgroundParticles.particleCount; num11++)
						{
							if (num != playgroundParticles.playgroundCache.lifetimeOffset.Length)
							{
								playgroundParticles.isSettingLifetime = false;
								return;
							}
							playgroundParticles.playgroundCache.lifetimeOffset[num11 % playgroundParticles.particleCount] = 0f;
						}
					}
					break;
				}
				case SORTINGC.NearestNeighborReversed:
				{
					playgroundParticles.nearestNeighborOrigin = Mathf.Clamp(playgroundParticles.nearestNeighborOrigin, 0, playgroundParticles.particleCount - 1);
					float[] array2 = new float[playgroundParticles.particleCount];
					float num12 = 0f;
					Vector3 a2 = Vector3.zero;
					switch (playgroundParticles.nearestNeighborOriginMethod)
					{
					case NEARESTNEIGHBORORIGINMETHOD.SourcePoint:
						a2 = playgroundParticles.playgroundCache.targetPosition[playgroundParticles.nearestNeighborOrigin % playgroundParticles.particleCount];
						break;
					case NEARESTNEIGHBORORIGINMETHOD.Vector3:
						a2 = playgroundParticles.nearestNeighborOriginVector3;
						break;
					case NEARESTNEIGHBORORIGINMETHOD.Transform:
						a2 = playgroundParticles.nearestNeighborOriginTransformPosition;
						break;
					}
					for (int num13 = 0; num13 < playgroundParticles.particleCount; num13++)
					{
						if (num != playgroundParticles.playgroundCache.lifetimeOffset.Length)
						{
							playgroundParticles.isSettingLifetime = false;
							return;
						}
						array2[num13 % playgroundParticles.particleCount] = Vector3.SqrMagnitude(a2 - playgroundParticles.playgroundCache.targetPosition[num13 % playgroundParticles.particleCount]);
						if (array2[num13 % playgroundParticles.particleCount] > num12)
						{
							num12 = array2[num13 % playgroundParticles.particleCount];
						}
					}
					if (num12 > 0f)
					{
						for (int num14 = 0; num14 < playgroundParticles.particleCount; num14++)
						{
							if (num != playgroundParticles.playgroundCache.lifetimeOffset.Length)
							{
								playgroundParticles.isSettingLifetime = false;
								return;
							}
							playgroundParticles.playgroundCache.lifetimeOffset[num14 % playgroundParticles.particleCount] = Mathf.Lerp(playgroundParticles.lifetime * (num2 - 0.001f), 0f, array2[num14 % playgroundParticles.particleCount] / num12);
						}
					}
					else
					{
						for (int num15 = 0; num15 < playgroundParticles.particleCount; num15++)
						{
							if (num != playgroundParticles.playgroundCache.lifetimeOffset.Length)
							{
								playgroundParticles.isSettingLifetime = false;
								return;
							}
							playgroundParticles.playgroundCache.lifetimeOffset[num15 % playgroundParticles.particleCount] = 0f;
						}
					}
					break;
				}
				case SORTINGC.Custom:
					for (int num16 = playgroundParticles.particleCount - 1; num16 >= 0; num16--)
					{
						if (num != playgroundParticles.playgroundCache.lifetimeOffset.Length)
						{
							playgroundParticles.isSettingLifetime = false;
							return;
						}
						playgroundParticles.playgroundCache.lifetimeOffset[num16] = playgroundParticles.lifetime * playgroundParticles.lifetimeEmission * playgroundParticles.lifetimeSorting.Evaluate((float)num16 * 1f / (float)playgroundParticles.particleCount * 1f);
					}
					break;
				}
			}
			PlaygroundParticlesC.SetParticleTimeNow(playgroundParticles);
			PlaygroundParticlesC.SetEmissionRate(playgroundParticles);
			playgroundParticles.previousLifetime = playgroundParticles.lifetime;
			playgroundParticles.previousLifetimeEmission = playgroundParticles.lifetimeEmission;
			playgroundParticles.previousNearestNeighborOrigin = playgroundParticles.nearestNeighborOrigin;
			playgroundParticles.previousNearestNeighborOriginMethod = playgroundParticles.nearestNeighborOriginMethod;
			playgroundParticles.previousNearestNeighborOriginVector3 = playgroundParticles.nearestNeighborOriginVector3;
			playgroundParticles.previousNearestNeighborOriginTransform = playgroundParticles.nearestNeighborOriginTransform;
			playgroundParticles.previousSorting = playgroundParticles.sorting;
			playgroundParticles.isDoneThread = true;
			playgroundParticles.localDeltaTime = 0f;
			playgroundParticles.localTime = PlaygroundC.globalTime;
			playgroundParticles.lastTimeUpdated = PlaygroundC.globalTime;
			playgroundParticles.isSettingLifetime = false;
		}

		// Token: 0x0600092C RID: 2348 RVA: 0x00037950 File Offset: 0x00035B50
		public static void SetLifetimeSubtraction(PlaygroundParticlesC playgroundParticles)
		{
			playgroundParticles.playgroundCache.lifetimeSubtraction = new float[playgroundParticles.particleCount];
			System.Random random = new System.Random();
			for (int i = 0; i < playgroundParticles.playgroundCache.lifetimeSubtraction.Length; i++)
			{
				if (playgroundParticles.lifetimeValueMethod == VALUEMETHOD.Constant)
				{
					playgroundParticles.playgroundCache.lifetimeSubtraction[i] = 0f;
				}
				else
				{
					playgroundParticles.playgroundCache.lifetimeSubtraction[i] = PlaygroundParticlesC.RandomRange(random, 0f, playgroundParticles.lifetime - playgroundParticles.lifetimeMin);
				}
			}
			playgroundParticles.previousLifetimeMin = playgroundParticles.lifetimeMin;
			playgroundParticles.previousLifetimeValueMethod = playgroundParticles.lifetimeValueMethod;
		}

		// Token: 0x0600092D RID: 2349 RVA: 0x000379F8 File Offset: 0x00035BF8
		public static void SetEmissionRate(PlaygroundParticlesC playgroundParticles)
		{
			if (playgroundParticles.playgroundCache.emission == null)
			{
				return;
			}
			float num = playgroundParticles.lifetime * playgroundParticles.emissionRate;
			int num2 = playgroundParticles.playgroundCache.emission.Length;
			bool flag = playgroundParticles.source != SOURCEC.Transform && (playgroundParticles.overflowOffset != Vector3.zero || (playgroundParticles.applySourceScatter && (playgroundParticles.sourceScatterMin != Vector3.zero || playgroundParticles.sourceScatterMax != Vector3.zero)));
			for (int i = 0; i < playgroundParticles.playgroundCache.emission.Length; i++)
			{
				if (num2 != playgroundParticles.playgroundCache.emission.Length || playgroundParticles.playgroundCache.lifetimeOffset.Length != num2)
				{
					return;
				}
				if (playgroundParticles.emissionRate != 0f && playgroundParticles.source != SOURCEC.Script)
				{
					if (playgroundParticles.sorting != SORTINGC.Burst || (playgroundParticles.sorting == SORTINGC.NearestNeighbor && flag) || (playgroundParticles.sorting == SORTINGC.NearestNeighborReversed && flag))
					{
						playgroundParticles.playgroundCache.emission[i] = (playgroundParticles.playgroundCache.lifetimeOffset[i] >= playgroundParticles.lifetime - num && playgroundParticles.emit);
					}
					else
					{
						playgroundParticles.playgroundCache.emission[i] = (playgroundParticles.emit && playgroundParticles.emissionRate > (float)i * 1f / ((float)num2 * 1f));
					}
				}
				else
				{
					playgroundParticles.playgroundCache.emission[i] = false;
				}
				if (playgroundParticles.playgroundCache.emission[i])
				{
					playgroundParticles.playgroundCache.rebirth[i] = true;
					playgroundParticles.playgroundCache.simulate[i] = true;
				}
				else if (playgroundParticles.source == SOURCEC.Script)
				{
					playgroundParticles.playgroundCache.rebirth[i] = false;
				}
			}
			playgroundParticles.previousEmissionRate = playgroundParticles.emissionRate;
			playgroundParticles.hasActiveParticles = true;
			playgroundParticles.threadHadNoActiveParticles = false;
		}

		// Token: 0x0600092E RID: 2350 RVA: 0x00037C04 File Offset: 0x00035E04
		public static void SetParticleTimeNow(PlaygroundParticlesC playgroundParticles)
		{
			if (playgroundParticles.playgroundCache == null || playgroundParticles.playgroundCache.lifetimeOffset == null || playgroundParticles.playgroundCache.lifetimeOffset.Length != playgroundParticles.particleCount)
			{
				return;
			}
			if (playgroundParticles.playgroundCache.life == null || playgroundParticles.playgroundCache.life.Length != playgroundParticles.particleCount)
			{
				return;
			}
			playgroundParticles.isSettingParticleTime = true;
			if (playgroundParticles.source != SOURCEC.Script)
			{
				float num = PlaygroundC.globalTime + playgroundParticles.lifetimeOffset;
				if (num <= 0f)
				{
					num = playgroundParticles.localTime + 0.1f;
				}
				for (int i = 0; i < playgroundParticles.particleCount; i++)
				{
					playgroundParticles.playgroundCache.birth[i] = num + playgroundParticles.playgroundCache.lifetimeOffset[i] - playgroundParticles.lifetime;
					playgroundParticles.playgroundCache.death[i] = playgroundParticles.playgroundCache.birth[i] + playgroundParticles.lifetime;
					playgroundParticles.playgroundCache.life[i] = playgroundParticles.playgroundCache.death[i] - playgroundParticles.playgroundCache.lifetimeOffset[i] - playgroundParticles.playgroundCache.birth[i];
					playgroundParticles.particleCache[i].startLifetime = playgroundParticles.lifetime;
					playgroundParticles.particleCache[i].startSize = 0f;
					playgroundParticles.playgroundCache.targetPosition[i] = PlaygroundC.initialTargetPosition;
					playgroundParticles.playgroundCache.previousTargetPosition[i] = PlaygroundC.initialTargetPosition;
					playgroundParticles.playgroundCache.position[i] = PlaygroundC.initialTargetPosition;
					playgroundParticles.playgroundCache.simulate[i] = true;
					playgroundParticles.playgroundCache.emission[i] = true;
					playgroundParticles.playgroundCache.isFirstLoop[i] = true;
					playgroundParticles.playgroundCache.isNonBirthed[i] = true;
					playgroundParticles.playgroundCache.isCalculatedThisFrame[i] = false;
					if (!playgroundParticles.isPrewarming)
					{
						playgroundParticles.playgroundCache.rebirth[i] = true;
					}
				}
				playgroundParticles.localTime = num;
				playgroundParticles.lastTimeUpdated = playgroundParticles.localTime;
				playgroundParticles.localDeltaTime = 0f;
				playgroundParticles.t = 0f;
				playgroundParticles.simulationStarted = playgroundParticles.localTime;
				playgroundParticles.cameFromNonEmissionFrame = true;
				playgroundParticles.hasActiveParticles = true;
				playgroundParticles.threadHadNoActiveParticles = false;
			}
			playgroundParticles.isSettingParticleTime = false;
		}

		// Token: 0x0600092F RID: 2351 RVA: 0x00037E68 File Offset: 0x00036068
		public static void SetParticleTimeNowWithRestEmission(PlaygroundParticlesC playgroundParticles)
		{
			playgroundParticles.isSettingParticleTime = true;
			float num = playgroundParticles.localTime;
			float num2 = num - playgroundParticles.emissionStopped;
			if (playgroundParticles.loop && num2 < playgroundParticles.lifetime && num2 > 0f)
			{
				playgroundParticles.cameFromNonEmissionFrame = true;
				for (int i = 0; i < playgroundParticles.particleCount; i++)
				{
					playgroundParticles.playgroundCache.birthDelay[i] = num2;
					playgroundParticles.playgroundCache.rebirth[i] = true;
					playgroundParticles.playgroundCache.simulate[i] = true;
					playgroundParticles.playgroundCache.emission[i] = true;
				}
				playgroundParticles.isSettingParticleTime = false;
				return;
			}
			PlaygroundParticlesC.SetParticleTimeNow(playgroundParticles);
		}

		// Token: 0x06000930 RID: 2352 RVA: 0x00037F18 File Offset: 0x00036118
		public static Color32 GetColorAtLifetime(PlaygroundParticlesC playgroundParticles, float time)
		{
			return playgroundParticles.lifetimeColor.Evaluate(time / playgroundParticles.lifetime);
		}

		// Token: 0x06000931 RID: 2353 RVA: 0x00037F34 File Offset: 0x00036134
		public static void SetColorAtLifetime(PlaygroundParticlesC playgroundParticles, float time)
		{
			Color32 color = playgroundParticles.lifetimeColor.Evaluate(time / playgroundParticles.lifetime);
			for (int i = 0; i < playgroundParticles.particleCount; i++)
			{
				playgroundParticles.SetParticleColorInternal(i, color);
			}
			playgroundParticles.shurikenParticleSystem.SetParticles(playgroundParticles.particleCache, playgroundParticles.particleCache.Length);
		}

		// Token: 0x06000932 RID: 2354 RVA: 0x00037F94 File Offset: 0x00036194
		public static void SetColorWithLifetimeSorting(PlaygroundParticlesC playgroundParticles)
		{
			PlaygroundParticlesC.SetLifetime(playgroundParticles, playgroundParticles.sorting, playgroundParticles.lifetime);
			for (int i = 0; i < playgroundParticles.particleCount; i++)
			{
				Color32 color = playgroundParticles.lifetimeColor.Evaluate(playgroundParticles.playgroundCache.life[i] / playgroundParticles.lifetime);
				playgroundParticles.SetParticleColorInternal(i, color);
			}
			playgroundParticles.shurikenParticleSystem.SetParticles(playgroundParticles.particleCache, playgroundParticles.particleCache.Length);
		}

		// Token: 0x06000933 RID: 2355 RVA: 0x00038010 File Offset: 0x00036210
		public virtual bool IsSettingParticleCount()
		{
			return this.isSettingParticleCount;
		}

		// Token: 0x06000934 RID: 2356 RVA: 0x00038018 File Offset: 0x00036218
		public static void SetParticleCount(PlaygroundParticlesC playgroundParticles, int amount)
		{
			if (playgroundParticles.isSettingParticleCount)
			{
				return;
			}
			if (playgroundParticles.isPrewarming)
			{
				return;
			}
			if (amount < 0)
			{
				amount = 0;
			}
			if (playgroundParticles.internalRandom01 == null)
			{
				playgroundParticles.RefreshSystemRandom();
			}
			playgroundParticles.particleCount = amount;
			playgroundParticles.previousParticleCount = amount;
			playgroundParticles.particleCache = new ParticleSystem.Particle[amount];
			playgroundParticles.shurikenParticleSystem.Emit(amount);
			playgroundParticles.shurikenParticleSystem.GetParticles(playgroundParticles.particleCache);
			playgroundParticles.collisionCache = null;
			playgroundParticles.inTransition = false;
			playgroundParticles.hasActiveParticles = true;
			playgroundParticles.threadHadNoActiveParticles = false;
			playgroundParticles.isSettingParticleCount = true;
			if (playgroundParticles.multithreadedStartup)
			{
				PlaygroundC.RunAsync(delegate()
				{
					PlaygroundParticlesC.SetParticleCountAsyncFriendly(playgroundParticles, amount);
				}, ThreadPoolMethod.ThreadPool);
			}
			else
			{
				PlaygroundParticlesC.SetParticleCountAsyncFriendly(playgroundParticles, amount);
			}
		}

		// Token: 0x06000935 RID: 2357 RVA: 0x00038168 File Offset: 0x00036368
		private static void SetParticleCountAsyncFriendly(PlaygroundParticlesC playgroundParticles, int amount)
		{
			if (!playgroundParticles.isSettingParticleCount)
			{
				return;
			}
			if (playgroundParticles.playgroundCache == null)
			{
				playgroundParticles.playgroundCache = new PlaygroundCache();
			}
			playgroundParticles.playgroundCache.size = new float[amount];
			playgroundParticles.playgroundCache.birth = new float[amount];
			playgroundParticles.playgroundCache.death = new float[amount];
			playgroundParticles.playgroundCache.rebirth = new bool[amount];
			playgroundParticles.playgroundCache.birthDelay = new float[amount];
			playgroundParticles.playgroundCache.life = new float[amount];
			playgroundParticles.playgroundCache.lifetimeSubtraction = new float[amount];
			playgroundParticles.playgroundCache.rotation = new float[amount];
			playgroundParticles.playgroundCache.lifetimeOffset = new float[amount];
			playgroundParticles.playgroundCache.emission = new bool[amount];
			playgroundParticles.playgroundCache.changedByProperty = new bool[amount];
			playgroundParticles.playgroundCache.changedByPropertyColor = new bool[amount];
			playgroundParticles.playgroundCache.changedByPropertyColorLerp = new bool[amount];
			playgroundParticles.playgroundCache.changedByPropertyColorKeepAlpha = new bool[amount];
			playgroundParticles.playgroundCache.changedByPropertySize = new bool[amount];
			playgroundParticles.playgroundCache.changedByPropertyTarget = new bool[amount];
			playgroundParticles.playgroundCache.changedByPropertyDeath = new bool[amount];
			playgroundParticles.playgroundCache.propertyTarget = new int[amount];
			playgroundParticles.playgroundCache.propertyId = new int[amount];
			playgroundParticles.playgroundCache.excludeFromManipulatorId = new int[amount];
			playgroundParticles.playgroundCache.propertyColorId = new int[amount];
			playgroundParticles.playgroundCache.manipulatorId = new int[amount];
			playgroundParticles.playgroundCache.color = new Color32[amount];
			playgroundParticles.playgroundCache.scriptedColor = new Color32[amount];
			playgroundParticles.playgroundCache.initialColor = new Color32[amount];
			playgroundParticles.playgroundCache.lifetimeColorId = new int[amount];
			playgroundParticles.playgroundCache.noForce = new bool[amount];
			playgroundParticles.playgroundCache.position = new Vector3[amount];
			playgroundParticles.playgroundCache.targetPosition = new Vector3[amount];
			playgroundParticles.playgroundCache.targetDirection = new Vector3[amount];
			playgroundParticles.playgroundCache.previousTargetPosition = new Vector3[amount];
			playgroundParticles.playgroundCache.previousParticlePosition = new Vector3[amount];
			playgroundParticles.playgroundCache.collisionParticlePosition = new Vector3[amount];
			playgroundParticles.playgroundCache.localSpaceMovementCompensation = new Vector3[amount];
			playgroundParticles.playgroundCache.scatterPosition = new Vector3[amount];
			playgroundParticles.playgroundCache.velocity = new Vector3[amount];
			playgroundParticles.playgroundCache.isMasked = new bool[amount];
			playgroundParticles.playgroundCache.maskAlpha = new float[amount];
			playgroundParticles.playgroundCache.isNonBirthed = new bool[amount];
			playgroundParticles.playgroundCache.isFirstLoop = new bool[amount];
			playgroundParticles.playgroundCache.simulate = new bool[amount];
			playgroundParticles.playgroundCache.isCalculatedThisFrame = new bool[amount];
			playgroundParticles.playgroundCache.maskSorting = null;
			for (int i = 0; i < amount; i++)
			{
				playgroundParticles.particleCache[i].startSize = 0f;
				playgroundParticles.playgroundCache.rebirth[i] = true;
				playgroundParticles.playgroundCache.simulate[i] = true;
				playgroundParticles.playgroundCache.isNonBirthed[i] = true;
				playgroundParticles.playgroundCache.isFirstLoop[i] = true;
				if (playgroundParticles.colorSource == COLORSOURCEC.LifetimeColors && playgroundParticles.lifetimeColors.Count > 0)
				{
					playgroundParticles.lifetimeColorId++;
					playgroundParticles.lifetimeColorId %= playgroundParticles.lifetimeColors.Count;
					playgroundParticles.playgroundCache.lifetimeColorId[i] = playgroundParticles.lifetimeColorId;
				}
			}
			PlaygroundParticlesC.SetSizeRandom(playgroundParticles, playgroundParticles.sizeMin, playgroundParticles.sizeMax);
			playgroundParticles.previousSizeMin = playgroundParticles.sizeMin;
			playgroundParticles.previousSizeMax = playgroundParticles.sizeMax;
			playgroundParticles.playgroundCache.initialRotation = PlaygroundParticlesC.RandomFloat(amount, playgroundParticles.initialRotationMin, playgroundParticles.initialRotationMax, playgroundParticles.internalRandom01);
			playgroundParticles.playgroundCache.rotationSpeed = PlaygroundParticlesC.RandomFloat(amount, playgroundParticles.rotationSpeedMin, playgroundParticles.rotationSpeedMax, playgroundParticles.internalRandom01);
			playgroundParticles.previousInitialRotationMin = playgroundParticles.initialRotationMin;
			playgroundParticles.previousInitialRotationMax = playgroundParticles.initialRotationMax;
			playgroundParticles.previousRotationSpeedMin = playgroundParticles.rotationSpeedMin;
			playgroundParticles.previousRotationSpeedMax = playgroundParticles.rotationSpeedMax;
			PlaygroundParticlesC.SetVelocityRandom(playgroundParticles, playgroundParticles.initialVelocityMin, playgroundParticles.initialVelocityMax);
			PlaygroundParticlesC.SetLocalVelocityRandom(playgroundParticles, playgroundParticles.initialLocalVelocityMin, playgroundParticles.initialLocalVelocityMax);
			PlaygroundParticlesC.Emission(playgroundParticles, playgroundParticles.emit, false);
			if (playgroundParticles.applySourceScatter)
			{
				playgroundParticles.RefreshScatter();
			}
			playgroundParticles.isDoneThread = true;
			playgroundParticles.isSettingParticleCount = false;
		}

		// Token: 0x06000936 RID: 2358 RVA: 0x00038614 File Offset: 0x00036814
		public virtual bool UpdateSystem()
		{
			if (this.isYieldRefreshing || this.isLoading || this.playgroundCache == null || this.thisInstance == null || !this.particleSystemGameObject.activeInHierarchy || !this.particleSystemGameObject.activeSelf || !base.enabled || this.isSettingLifetime || this.isSettingParticleCount || this.isPrewarming || this.inPlayback)
			{
				return false;
			}
			if (Application.isPlaying && this.queueEmissionHalt && !this.IsAlive() && !this.loop && this.loopExceeded && this.hasEmitted)
			{
				if (this.disableOnDoneRoutine == ONDONE.Inactivate)
				{
					this.particleSystemGameObject.SetActive(false);
					return false;
				}
				UnityEngine.Object.DestroyImmediate(this.particleSystemGameObject);
				return false;
			}
			else
			{
				if (this.emit)
				{
					this.hasEmitted = true;
				}
				if (this.source != this.prevSource)
				{
					this.prevSource = this.source;
					return false;
				}
				if (this.particleCount != this.previousParticleCount)
				{
					PlaygroundParticlesC.SetParticleCount(this.thisInstance, this.particleCount);
					this.isDoneThread = true;
					if (this.particleCount > 0)
					{
						base.StartCoroutine(this.Boot());
					}
					return false;
				}
				if (this.emit != this.previousEmission)
				{
					this.Emit(this.emit);
					return false;
				}
				if (this.loop != this.previousLoop)
				{
					if (this.emit && this.loop)
					{
						this.Emit(true);
					}
					this.previousLoop = this.loop;
					return false;
				}
				if (this.sizeMin != this.previousSizeMin || this.sizeMax != this.previousSizeMax)
				{
					PlaygroundParticlesC.SetSizeRandom(this.thisInstance, this.sizeMin, this.sizeMax);
				}
				if (this.initialRotationMin != this.previousInitialRotationMin || this.initialRotationMax != this.previousInitialRotationMax)
				{
					PlaygroundParticlesC.SetInitialRotationRandom(this.thisInstance, this.initialRotationMin, this.initialRotationMax);
				}
				if (this.rotationSpeedMin != this.previousRotationSpeedMin || this.rotationSpeedMax != this.previousRotationSpeedMax)
				{
					PlaygroundParticlesC.SetRotationRandom(this.thisInstance, this.rotationSpeedMin, this.rotationSpeedMax);
				}
				if (this.applyInitialVelocity && (this.initialVelocityMin != this.previousVelocityMin || this.initialVelocityMax != this.previousVelocityMax || this.initialVelocityMethod != this.previousVelocityMethod || this.playgroundCache.initialVelocity == null || this.playgroundCache.initialVelocity.Length != this.particleCount))
				{
					PlaygroundParticlesC.SetVelocityRandom(this.thisInstance, this.initialVelocityMin, this.initialVelocityMax);
					return false;
				}
				if (this.applyInitialLocalVelocity && (this.initialLocalVelocityMin != this.previousLocalVelocityMin || this.initialLocalVelocityMax != this.previousLocalVelocityMax || this.initialLocalVelocityMethod != this.previousLocalVelocityMethod || this.playgroundCache.initialLocalVelocity == null || this.playgroundCache.initialLocalVelocity.Length != this.particleCount))
				{
					PlaygroundParticlesC.SetLocalVelocityRandom(this.thisInstance, this.initialLocalVelocityMin, this.initialLocalVelocityMax);
					return false;
				}
				if (this.previousLifetime != this.lifetime || (this.lifetimeValueMethod == VALUEMETHOD.Constant && this.previousLifetimeValueMethod != this.lifetimeValueMethod))
				{
					this.Start();
					return false;
				}
				if (this.previousNearestNeighborOriginMethod != this.nearestNeighborOriginMethod || ((this.sorting == SORTINGC.NearestNeighbor || this.sorting == SORTINGC.NearestNeighborReversed) && ((this.nearestNeighborOriginMethod == NEARESTNEIGHBORORIGINMETHOD.SourcePoint && this.previousNearestNeighborOrigin != this.nearestNeighborOrigin) || (this.nearestNeighborOriginMethod == NEARESTNEIGHBORORIGINMETHOD.Vector3 && this.previousNearestNeighborOriginVector3 != this.nearestNeighborOriginVector3) || (this.nearestNeighborOriginMethod == NEARESTNEIGHBORORIGINMETHOD.Transform && this.previousNearestNeighborOriginTransform != this.nearestNeighborOriginTransform))) || this.previousSorting != this.sorting || this.previousLifetimeEmission != this.lifetimeEmission)
				{
					this.Start();
					return false;
				}
				if (this.lifetimeValueMethod == VALUEMETHOD.RandomBetweenTwoValues && (this.previousLifetimeMin != this.lifetimeMin || this.previousLifetime != this.lifetime || this.previousLifetimeValueMethod != this.lifetimeValueMethod))
				{
					PlaygroundParticlesC.SetLifetimeSubtraction(this.thisInstance);
					this.previousLifetimeMin = this.lifetimeMin;
				}
				if (this.previousEmissionRate != this.emissionRate && this.source != SOURCEC.Script)
				{
					PlaygroundParticlesC.SetEmissionRate(this.thisInstance);
				}
				if (this.source == SOURCEC.State && this.activeState != this.previousActiveState)
				{
					if (this.states[this.activeState].positionLength > this.particleCount)
					{
						PlaygroundParticlesC.SetParticleCount(this.thisInstance, this.states[this.activeState].positionLength);
					}
					this.previousActiveState = this.activeState;
				}
				return true;
			}
		}

		// Token: 0x06000937 RID: 2359 RVA: 0x00038B74 File Offset: 0x00036D74
		public virtual void UpdateShuriken()
		{
			if (!this.isReadyForThreadedCalculations || !this.calculate || this.inPlayback || (this.source == SOURCEC.Spline && this.splines.Count == 0))
			{
				return;
			}
			if (this.collision)
			{
				PlaygroundParticlesC.Collisions(this.thisInstance);
			}
			if (!this.particleSystemRenderer.enabled)
			{
				return;
			}
			if (this.syncPositionsOnMainThread || this.collision || (this.forceSkinnedMeshUpdateOnMainThread && this.source == SOURCEC.SkinnedWorldObject && (this.onlySourcePositioning || this.onlyLifetimePositioning)))
			{
				if (this.particleCache.Length != this.playgroundCache.position.Length || this.particleCount != this.playgroundCache.isCalculatedThisFrame.Length)
				{
					return;
				}
				if (this.playgroundCache.life.Length == this.particleCount && this.playgroundCache.simulate.Length == this.particleCount)
				{
					bool flag = this.onlySourcePositioning && !this.cancelDeltaPositioningOnSync;
					float num = (this.minShurikenLifetime >= 1E-05f) ? this.minShurikenLifetime : 1E-05f;
					float y = PlaygroundC.initialTargetPosition.y;
					for (int i = 0; i < this.particleCount; i++)
					{
						if (this.playgroundCache.isCalculatedThisFrame[i])
						{
							if (flag || (this.playgroundCache.life[i] == 0f && this.playgroundCache.simulate[i] && !this.onlyLifetimePositioning))
							{
								this.particleCache[i].lifetime = this.lifetime;
								this.playgroundCache.previousTargetPosition[i] = this.playgroundCache.targetPosition[i];
								this.SetSourcePosition(i);
								this.playgroundCache.position[i] = this.playgroundCache.targetPosition[i];
							}
							this.particleCache[i].position = this.playgroundCache.position[i];
							if (this.playgroundCache.life[i] != 0f)
							{
								float num2 = this.playgroundCache.death[i] - this.localTime;
								if (num2 < num)
								{
									num2 = num;
								}
								this.particleCache[i].lifetime = num2;
							}
							this.particleCache[i].startSize = ((this.playgroundCache.maskAlpha[i] <= 0f || this.particleCache[i].position.y == y) ? 0f : this.playgroundCache.size[i]);
							this.particleCache[i].rotation = this.playgroundCache.rotation[i];
						}
					}
				}
			}
			if (!this.inTransition && this.particleCache != null && this.particleCache.Length > 0 && this.calculate && this.hasActiveParticles && !this.isPrewarming)
			{
				this.shurikenParticleSystem.SetParticles(this.particleCache, this.particleCache.Length);
			}
			else if (this.particleCache.Length == 0 && this.hasActiveParticles)
			{
				this.shurikenParticleSystem.Clear();
				this.shurikenParticleSystem.Stop();
				this.hasActiveParticles = false;
				this.isDoneThread = true;
			}
			if (this.hasActiveParticles && this.calculate && (this.shurikenParticleSystem.isPaused || this.shurikenParticleSystem.isStopped))
			{
				this.shurikenParticleSystem.Play();
			}
		}

		// Token: 0x06000938 RID: 2360 RVA: 0x00038F80 File Offset: 0x00037180
		public static void SetInitialTargetPosition(PlaygroundParticlesC playgroundParticles, Vector3 position, bool refreshParticleSystem)
		{
			for (int i = 0; i < playgroundParticles.particleCache.Length; i++)
			{
				playgroundParticles.playgroundCache.previousTargetPosition[i] = position;
				playgroundParticles.playgroundCache.targetPosition[i] = position;
				playgroundParticles.particleCache[i].startSize = 0f;
				playgroundParticles.particleCache[i].position = position;
				playgroundParticles.playgroundCache.position[i] = position;
				playgroundParticles.playgroundCache.collisionParticlePosition[i] = position;
			}
			if (refreshParticleSystem)
			{
				playgroundParticles.GetComponent<ParticleSystem>().SetParticles(playgroundParticles.particleCache, playgroundParticles.particleCache.Length);
			}
		}

		// Token: 0x06000939 RID: 2361 RVA: 0x0003904C File Offset: 0x0003724C
		public static void Emission(PlaygroundParticlesC playgroundParticles, bool emission, bool callRestEmission)
		{
			playgroundParticles.previousEmission = emission;
			if (emission)
			{
				PlaygroundC.RunAsync(delegate()
				{
					for (int i = 0; i < playgroundParticles.playgroundCache.rebirth.Length; i++)
					{
						playgroundParticles.playgroundCache.rebirth[i] = true;
						if (!callRestEmission)
						{
							playgroundParticles.playgroundCache.simulate[i] = true;
						}
					}
					if (callRestEmission)
					{
						PlaygroundParticlesC.SetParticleTimeNowWithRestEmission(playgroundParticles);
					}
					playgroundParticles.emissionStopped = 0f;
					playgroundParticles.hasActiveParticles = true;
					playgroundParticles.threadHadNoActiveParticles = false;
				});
			}
		}

		// Token: 0x0600093A RID: 2362 RVA: 0x00039090 File Offset: 0x00037290
		public static float SignedAngle(Vector3 a, Vector3 b, Vector3 n)
		{
			return Vector3.Angle(a, b) * Mathf.Sign(Vector3.Dot(n.normalized, Vector3.Cross(a, b)));
		}

		// Token: 0x0600093B RID: 2363 RVA: 0x000390B4 File Offset: 0x000372B4
		public static Vector3 RandomVector3(System.Random random, Vector3 v1, Vector3 v2)
		{
			return PlaygroundParticlesC.RandomRange(random, v1, v2);
		}

		// Token: 0x0600093C RID: 2364 RVA: 0x000390C0 File Offset: 0x000372C0
		public virtual bool PrepareThreadedCalculations()
		{
			if (!base.enabled)
			{
				return false;
			}
			if (this.inPlayback)
			{
				return false;
			}
			if (this.pauseCalculationWhenInvisible)
			{
				if (!false && Camera.main != null && PlaygroundC.frustumPlanes != null)
				{
					bool flag = GeometryUtility.TestPlanesAABB(PlaygroundC.frustumPlanes, new Bounds((!(this.calculationTriggerTransform == null)) ? (this.calculationTriggerTransform.position + this.calculationTriggerOffset) : (this.particleSystemTransform.position + this.calculationTriggerOffset), this.calculationTriggerSize));
					if (!flag && this.calculate && !this.particleSystemRenderer.isVisible)
					{
						this.calculate = false;
						return false;
					}
					if (flag && !this.calculate)
					{
						this.calculate = true;
						if (this.prewarm)
						{
							this.Start();
							return false;
						}
						PlaygroundParticlesC.SetParticleTimeNow(this.thisInstance);
					}
				}
			}
			else if (!this.calculate)
			{
				this.calculate = true;
				if (this.prewarm)
				{
					this.Start();
					return false;
				}
				PlaygroundParticlesC.SetParticleTimeNow(this.thisInstance);
			}
			if (!this.calculate)
			{
				return false;
			}
			if (this.cameFromNonCalculatedFrame && this.hasActiveParticles)
			{
				base.StartCoroutine(this.Boot());
				this.cameFromNonCalculatedFrame = false;
				return false;
			}
			if (this.applyLockPosition)
			{
				if (this.lockPositionIsLocal)
				{
					this.particleSystemTransform.localPosition = this.lockPosition;
				}
				else
				{
					this.particleSystemTransform.position = this.lockPosition;
				}
			}
			if (this.applyLockRotation)
			{
				if (this.lockRotationIsLocal)
				{
					this.particleSystemTransform.localRotation = Quaternion.Euler(this.lockRotation);
				}
				else
				{
					this.particleSystemTransform.rotation = Quaternion.Euler(this.lockRotation);
				}
			}
			if (this.applyLockScale)
			{
				this.particleSystemTransform.localScale = this.lockScale;
			}
			this.hasActiveParticles = (!this.threadHadNoActiveParticles || (this.emit && this.loop && this.particleCount > 0));
			if (!this.hasActiveParticles)
			{
				this.loopExceeded = true;
				if (this.disableOnDone)
				{
					this.queueEmissionHalt = true;
				}
			}
			this.realSimulationTime = this.particleTimescale * Time.timeScale;
			this.cancelDeltaPositioningOnSync = false;
			if (PlaygroundC.reference.IsDoneThread() && this.isDoneThread)
			{
				this.stRot = Quaternion.identity;
				this.stDir = default(Vector3);
			}
			this.localSpace = (this.shurikenParticleSystem.simulationSpace == ParticleSystemSimulationSpace.Local);
			this.overflow = (this.overflowOffset != Vector3.zero);
			this.skinnedWorldObjectReady = false;
			this.renderModeStretch = (this.particleSystemRenderer2.renderMode == ParticleSystemRenderMode.Stretch);
			this.particleSystemRotation = this.particleSystemTransform.rotation;
			this.particleSystemInverseRotation = this.particleSystemRotation;
			this.particleSystemInverseRotation.x = -this.particleSystemInverseRotation.x;
			this.particleSystemInverseRotation.y = -this.particleSystemInverseRotation.y;
			this.particleSystemInverseRotation.z = -this.particleSystemInverseRotation.z;
			this.particleSystemInverseRotation.w = -this.particleSystemInverseRotation.w;
			if (!this.onlySourcePositioning && !this.onlyLifetimePositioning && this.turbulenceType != TURBULENCETYPE.None && this.turbulenceType == TURBULENCETYPE.Simplex && this.turbulenceSimplex == null)
			{
				this.turbulenceSimplex = new SimplexNoise();
			}
			if (this.emit)
			{
				switch (this.source)
				{
				case SOURCEC.State:
					if (this.states.Count <= 0)
					{
						return false;
					}
					if (this.activeState > this.states.Count - 1)
					{
						this.activeState = this.states.Count - 1;
					}
					if (this.activeState < 0)
					{
						this.activeState = 0;
					}
					if (this.states[this.activeState].stateTransform != null)
					{
						if (this.isDoneThread)
						{
							if (!this.states[this.activeState].initialized)
							{
								this.states[this.activeState].Initialize();
							}
							this.stRot = this.states[this.activeState].stateTransform.rotation;
							this.states[this.activeState].UpdateMatrix(this.localSpace);
						}
						if (this.localSpace && (this.states[this.activeState].stateTransform.parent == this.particleSystemTransform || this.states[this.activeState].stateTransform == this.particleSystemTransform) && this.isDoneThread)
						{
							this.cancelDeltaPositioningOnSync = true;
							this.stRot = Quaternion.Euler(Vector3.zero);
						}
					}
					break;
				case SOURCEC.Transform:
					if (this.sourceTransforms == null)
					{
						this.sourceTransforms = new List<PlaygroundTransformC>();
					}
					if (this.sourceTransforms.Count == 0)
					{
						this.sourceTransforms.Add(new PlaygroundTransformC());
						this.sourceTransforms[0].transform = ((!(this.sourceTransform != null)) ? this.particleSystemTransform : this.sourceTransform);
					}
					if (this.isDoneThread)
					{
						for (int i = 0; i < this.sourceTransforms.Count; i++)
						{
							if (!this.sourceTransforms[i].Update())
							{
								return false;
							}
							if (this.IsLocalSpace())
							{
								this.psTransformNum = -1;
								this.sourceTransforms[i].SetLocalPosition(this.particleSystemTransform);
								this.sourceTransforms[i].SetPostitionAsLocal();
								if (this.sourceTransforms[i].IsSameAs(this.particleSystemTransform))
								{
									this.sourceTransforms[i].SetZeroRotation();
									this.psTransformNum = i;
								}
							}
						}
					}
					if (this.isDoneThread)
					{
						this.stRot = this.sourceTransform.rotation;
					}
					if (this.localSpace && this.sourceTransform == this.particleSystemTransform && this.isDoneThread)
					{
						this.cancelDeltaPositioningOnSync = true;
						this.stRot = Quaternion.Euler(Vector3.zero);
					}
					break;
				case SOURCEC.WorldObject:
					if (!(this.worldObject.gameObject != null))
					{
						return false;
					}
					if (this.worldObject.gameObject.GetInstanceID() != this.worldObject.cachedId || !this.worldObject.initialized)
					{
						this.worldObject = PlaygroundParticlesC.NewWorldObject(this.worldObject.gameObject.transform);
					}
					if (!(this.worldObject.mesh != null))
					{
						return false;
					}
					if (this.isDoneThread)
					{
						this.stRot = this.worldObject.transform.transform.rotation;
					}
					if (this.localSpace && this.isDoneThread)
					{
						this.cancelDeltaPositioningOnSync = true;
						this.stRot = Quaternion.Euler(Vector3.zero);
					}
					this.worldObject.UpdateMatrix(this.localSpace);
					this.worldObject.updateNormals = this.worldObjectUpdateNormals;
					if (this.worldObjectUpdateVertices)
					{
						this.worldObject.Update();
					}
					break;
				case SOURCEC.SkinnedWorldObject:
					if (this.skinnedWorldObject.gameObject != null && this.skinnedWorldObject.gameObject.GetInstanceID() != this.skinnedWorldObject.cachedId)
					{
						this.skinnedWorldObject = PlaygroundParticlesC.NewSkinnedWorldObject(this.skinnedWorldObject.gameObject.transform, this.skinnedWorldObject.downResolution);
					}
					this.skinnedWorldObjectReady = (this.skinnedWorldObject.gameObject != null && this.skinnedWorldObject.mesh != null);
					if (PlaygroundC.reference.skinnedMeshThreadMethod == ThreadMethodComponent.OneForAll && PlaygroundC.reference.IsFirstUnsafeAutomaticFrames() && !PlaygroundC.reference.IsDoneThreadSkinnedMeshes())
					{
						return false;
					}
					if (!this.skinnedWorldObjectReady)
					{
						return false;
					}
					if (this.isDoneThread)
					{
						this.stRot = this.skinnedWorldObject.transform.rotation;
						this.stDir = this.skinnedWorldObject.transform.TransformDirection(this.overflowOffset);
					}
					this.skinnedWorldObject.updateNormals = this.worldObjectUpdateNormals;
					if (Time.frameCount % PlaygroundC.skinnedUpdateRate == 0)
					{
						if (this.worldObjectUpdateVertices)
						{
							this.skinnedWorldObject.MeshUpdate();
						}
						this.skinnedWorldObject.BoneUpdate();
						if (this.forceSkinnedMeshUpdateOnMainThread)
						{
							this.skinnedWorldObject.Update();
						}
					}
					break;
				case SOURCEC.Paint:
					if (!this.paint.initialized)
					{
						this.paint.Initialize();
						return false;
					}
					if (this.isDoneThread)
					{
						this.stRot = this.particleSystemTransform.rotation;
					}
					if (this.paint.positionLength <= 0)
					{
						return false;
					}
					for (int j = 0; j < this.particleCache.Length; j++)
					{
						this.paint.Update(j);
					}
					break;
				case SOURCEC.Projection:
					if (!(this.projection.projectionTexture != null) || !(this.projection.projectionTransform != null))
					{
						return false;
					}
					if (!this.projection.initialized)
					{
						this.projection.Initialize();
					}
					this.stRot = this.projection.projectionTransform.rotation;
					if (this.localSpace)
					{
						this.shurikenParticleSystem.simulationSpace = ParticleSystemSimulationSpace.World;
					}
					if (this.projection.liveUpdate || !this.projection.hasRefreshed)
					{
						this.projection.UpdateSource();
						this.projection.Update();
						this.stDir = this.projection.projectionTransform.TransformDirection(this.overflowOffset);
						this.projection.hasRefreshed = true;
					}
					break;
				case SOURCEC.Spline:
					if (this.splines.Count <= 0)
					{
						return false;
					}
					for (int k = 0; k < this.splines.Count; k++)
					{
						if (this.splines[k] == null || !this.splines[k].enabled || !this.splines[k].IsReady())
						{
							return false;
						}
					}
					if (this.isDoneThread)
					{
						this.stRot = this.particleSystemTransform.rotation;
						if (this.localSpace)
						{
							this.cancelDeltaPositioningOnSync = true;
							this.stRot = Quaternion.Euler(Vector3.zero);
						}
					}
					break;
				}
			}
			this.stateReadyForTextureColor = (this.source == SOURCEC.State && this.states[this.activeState].stateTexture != null && this.states[this.activeState].colorLength > 0);
			this.hasEventManipulatorLocal = false;
			this.hasEventManipulatorGlobal = false;
			this.hasGlobalAffectingManipulators = false;
			this.manipulatorEventCount = 0;
			this.thisLayer = this.particleSystemGameObject.layer;
			for (int l = 0; l < this.manipulators.Count; l++)
			{
				this.manipulators[l].Update();
				this.manipulators[l].transform.SetLocalPosition(this.particleSystemTransform);
				this.manipulators[l].SetLocalTargetsPosition(this.particleSystemTransform);
				if (this.manipulators[l].trackParticles)
				{
					this.hasEventManipulatorLocal = true;
					this.manipulatorEventCount++;
				}
			}
			if (PlaygroundC.reference.HasEnabledGlobalManipulators())
			{
				for (int m = 0; m < PlaygroundC.reference.manipulators.Count; m++)
				{
					if ((PlaygroundC.reference.manipulators[m].affects.value & 1 << this.GetLayer()) != 0)
					{
						this.hasGlobalAffectingManipulators = true;
						PlaygroundC.reference.manipulators[m].transform.SetLocalPosition(this.particleSystemTransform);
						if (PlaygroundC.reference.manipulators[m].trackParticles && PlaygroundC.reference.threadMethod != ThreadMethod.NoThreads)
						{
							this.threadMethod = ThreadMethodLocal.OneForAll;
							this.hasEventManipulatorGlobal = true;
							this.manipulatorEventCount++;
						}
					}
				}
			}
			this.hasSeveralManipulatorEvents = (this.manipulatorEventCount > 1);
			this.hasEvent = (this.events.Count > 0);
			this.hasTimerEvent = false;
			if (this.hasEvent)
			{
				for (int n = 0; n < this.events.Count; n++)
				{
					this.events[n].Initialize();
					if (this.events[n].initializedTarget && this.events[n].broadcastType != EVENTBROADCASTC.EventListeners && !this.events[n].target.eventControlledBy.Contains(this.thisInstance))
					{
						this.events[n].target.eventControlledBy.Add(this.thisInstance);
					}
					if (this.events[n].eventType == EVENTTYPEC.Time && ((this.events[n].broadcastType != EVENTBROADCASTC.EventListeners && this.events[n].initializedTarget) || (this.events[n].broadcastType == EVENTBROADCASTC.EventListeners && this.events[n].initializedEvent)))
					{
						this.hasTimerEvent = this.events[n].UpdateTime();
					}
				}
			}
			this.hasCollisionCache = (this.collisionCache != null);
			return true;
		}

		// Token: 0x0600093D RID: 2365 RVA: 0x00039FB0 File Offset: 0x000381B0
		public static void NewCalculatedThread(PlaygroundParticlesC playgroundParticles)
		{
			if (playgroundParticles.isDoneThread && playgroundParticles.isReadyForThreadedCalculations && !playgroundParticles.IsYieldRefreshing())
			{
				playgroundParticles.isDoneThread = false;
				PlaygroundC.RunAsync(delegate()
				{
					if (playgroundParticles.isDoneThread || !playgroundParticles.isReadyForThreadedCalculations)
					{
						return;
					}
					PlaygroundParticlesC.ThreadedCalculations(playgroundParticles);
				});
			}
		}

		// Token: 0x0600093E RID: 2366 RVA: 0x0003A018 File Offset: 0x00038218
		public static void NewCalculatedThread(PlaygroundParticlesC[] playgroundParticles)
		{
			for (int i = 0; i < playgroundParticles.Length; i++)
			{
				if (playgroundParticles[i].isDoneThread && !playgroundParticles[i].IsYieldRefreshing() && playgroundParticles[i].threadMethod == ThreadMethodLocal.Inherit)
				{
					playgroundParticles[i].isDoneThread = false;
				}
			}
			PlaygroundC.RunAsync(delegate()
			{
				for (int j = 0; j < playgroundParticles.Length; j++)
				{
					if (!playgroundParticles[j].isDoneThread && PlaygroundC.reference.IsDoneThread() && playgroundParticles[j].isReadyForThreadedCalculations && playgroundParticles[j].threadMethod == ThreadMethodLocal.Inherit)
					{
						PlaygroundParticlesC.ThreadedCalculations(playgroundParticles[j]);
					}
				}
			});
		}

		// Token: 0x0600093F RID: 2367 RVA: 0x0003A0A0 File Offset: 0x000382A0
		public virtual Color32 GetParticleColor(int p, float normalizedLife, float normalizedP)
		{
			Color32 result = default(Color32);
			if (!this.playgroundCache.changedByPropertyColor[p] && !this.playgroundCache.changedByPropertyColorLerp[p])
			{
				switch (this.colorSource)
				{
				case COLORSOURCEC.Source:
					switch (this.source)
					{
					case SOURCEC.State:
						if (this.stateReadyForTextureColor)
						{
							result = this.states[this.activeState].GetColor(p % this.states[this.activeState].colorLength);
						}
						else
						{
							result = this.lifetimeColor.Evaluate((this.colorMethod != COLORMETHOD.Lifetime) ? normalizedP : normalizedLife);
						}
						goto IL_147;
					case SOURCEC.Script:
						result = this.playgroundCache.scriptedColor[p];
						goto IL_147;
					case SOURCEC.Paint:
						result = this.paint.GetColor(p);
						goto IL_147;
					case SOURCEC.Projection:
						result = this.projection.GetColor(p);
						goto IL_147;
					}
					result = this.lifetimeColor.Evaluate((this.colorMethod != COLORMETHOD.Lifetime) ? normalizedP : normalizedLife);
					IL_147:
					if (this.sourceUsesLifetimeAlpha)
					{
						result.a = (byte)(255f * Mathf.Clamp(this.lifetimeColor.Evaluate((this.colorMethod != COLORMETHOD.Lifetime) ? normalizedP : normalizedLife).a, 0f, (float)result.a));
					}
					break;
				case COLORSOURCEC.LifetimeColor:
					result = this.lifetimeColor.Evaluate((this.colorMethod != COLORMETHOD.Lifetime) ? normalizedP : normalizedLife);
					break;
				case COLORSOURCEC.LifetimeColors:
					if (this.lifetimeColors.Count > 0)
					{
						result = this.lifetimeColors[this.playgroundCache.lifetimeColorId[p] % this.lifetimeColors.Count].gradient.Evaluate((this.colorMethod != COLORMETHOD.Lifetime) ? normalizedP : normalizedLife);
					}
					else
					{
						result = this.lifetimeColor.Evaluate((this.colorMethod != COLORMETHOD.Lifetime) ? normalizedP : normalizedLife);
					}
					break;
				}
			}
			else
			{
				result = this.GetParticleColorInternal(p);
				if (this.playgroundCache.changedByPropertyColorKeepAlpha[p])
				{
					result.a = (byte)(255f * Mathf.Clamp(this.lifetimeColor.Evaluate((this.colorMethod != COLORMETHOD.Lifetime) ? normalizedP : normalizedLife).a, 0f, (float)result.a));
				}
			}
			if (this.colorMethod == COLORMETHOD.ParticleArray && this.arrayColorUsesAlpha)
			{
				result.a = (byte)(255f * this.arrayColorAlpha.Evaluate(normalizedLife).a);
			}
			if (this.applyParticleMask)
			{
				result.a = (byte)Mathf.Lerp(0f, (float)result.a, this.playgroundCache.maskAlpha[p]);
			}
			return result;
		}

		// Token: 0x06000940 RID: 2368 RVA: 0x0003A3C8 File Offset: 0x000385C8
		public virtual void SetSourcePosition(int p)
		{
			switch (this.source)
			{
			case SOURCEC.State:
				if (!this.overflow)
				{
					this.playgroundCache.targetPosition[p] = this.states[this.activeState].GetLocalPosition(p);
				}
				else
				{
					switch (this.overflowMode)
					{
					case OVERFLOWMODEC.SourceTransform:
						this.playgroundCache.targetPosition[p] = this.states[this.activeState].GetLocalPosition(p) + PlaygroundParticlesC.GetOverflow2(this.overflowOffset, p, this.states[this.activeState].positionLength);
						break;
					case OVERFLOWMODEC.World:
						this.playgroundCache.targetPosition[p] = this.states[this.activeState].GetLocalPosition(p) + PlaygroundParticlesC.GetOverflow2(this.overflowOffset, p, this.states[this.activeState].positionLength);
						break;
					case OVERFLOWMODEC.SourcePoint:
						this.playgroundCache.targetPosition[p] = this.states[this.activeState].GetLocalPosition(p) + PlaygroundParticlesC.GetOverflow2(this.overflowOffset, this.states[this.activeState].GetLocalNormal(p), p, this.states[this.activeState].positionLength);
						break;
					}
				}
				break;
			case SOURCEC.Transform:
				if (this.sourceTransforms.Count > 0)
				{
					if (this.treatAsOneTransform)
					{
						this.transformIndex = (int)((float)p * 1f / ((float)this.particleCount * 1f) * (float)this.sourceTransforms.Count) % this.sourceTransforms.Count;
					}
					else
					{
						this.transformIndex = p % this.sourceTransforms.Count;
					}
					if (this.transformIndex >= this.sourceTransforms.Count)
					{
						this.transformIndex = this.sourceTransforms.Count - 1;
					}
					if (!this.overflow)
					{
						this.playgroundCache.targetPosition[p] = this.sourceTransforms[this.transformIndex].position;
					}
					else
					{
						switch (this.overflowMode)
						{
						case OVERFLOWMODEC.SourceTransform:
							this.playgroundCache.targetPosition[p] = this.sourceTransforms[this.transformIndex].transformMatrix.MultiplyPoint3x4(PlaygroundParticlesC.GetOverflow2(this.overflowOffset, (!this.treatAsOneTransform) ? (p / this.sourceTransforms.Count) : (p % (this.particleCount / this.sourceTransforms.Count)), 1));
							break;
						case OVERFLOWMODEC.World:
							this.playgroundCache.targetPosition[p] = this.sourceTransforms[this.transformIndex].position + PlaygroundParticlesC.GetOverflow2(this.overflowOffset, (!this.treatAsOneTransform) ? (p / this.sourceTransforms.Count) : (p % (this.particleCount / this.sourceTransforms.Count)), 1);
							break;
						case OVERFLOWMODEC.SourcePoint:
							this.playgroundCache.targetPosition[p] = this.sourceTransforms[this.transformIndex].transformMatrix.MultiplyPoint3x4(PlaygroundParticlesC.GetOverflow2(this.overflowOffset, (!this.treatAsOneTransform) ? (p / this.sourceTransforms.Count) : (p % (this.particleCount / this.sourceTransforms.Count)), 1));
							break;
						}
					}
				}
				break;
			case SOURCEC.WorldObject:
				if (!this.overflow)
				{
					this.playgroundCache.targetPosition[p] = this.worldObject.transformMatrix.MultiplyPoint3x4(this.worldObject.vertexPositions[p % this.worldObject.vertexPositions.Length]);
				}
				else
				{
					switch (this.overflowMode)
					{
					case OVERFLOWMODEC.SourceTransform:
						this.playgroundCache.targetPosition[p] = this.worldObject.transformMatrix.MultiplyPoint3x4(this.worldObject.vertexPositions[p % this.worldObject.vertexPositions.Length] + PlaygroundParticlesC.GetOverflow2(this.overflowOffset, p, this.worldObject.vertexPositions.Length));
						break;
					case OVERFLOWMODEC.World:
						this.playgroundCache.targetPosition[p] = this.worldObject.transformMatrix.MultiplyPoint3x4(this.worldObject.vertexPositions[p % this.worldObject.vertexPositions.Length]) + PlaygroundParticlesC.GetOverflow2(this.overflowOffset, p, this.worldObject.vertexPositions.Length);
						break;
					case OVERFLOWMODEC.SourcePoint:
						this.playgroundCache.targetPosition[p] = this.worldObject.transformMatrix.MultiplyPoint3x4(this.worldObject.vertexPositions[p % this.worldObject.vertexPositions.Length] + PlaygroundParticlesC.GetOverflow2(this.overflowOffset, this.worldObject.normals[p % this.worldObject.normals.Length], p, this.worldObject.vertexPositions.Length));
						break;
					}
				}
				break;
			case SOURCEC.SkinnedWorldObject:
			{
				int downResolution = this.skinnedWorldObject.downResolution;
				int num = Mathf.RoundToInt((float)(p * downResolution)) % this.skinnedWorldObject.vertexPositions.Length;
				if (!this.overflow)
				{
					this.playgroundCache.targetPosition[p] = this.skinnedWorldObject.vertexPositions[num];
				}
				else
				{
					switch (this.overflowMode)
					{
					case OVERFLOWMODEC.SourceTransform:
						this.playgroundCache.targetPosition[p] = this.skinnedWorldObject.vertexPositions[num] + PlaygroundParticlesC.GetOverflow2(this.stDir, p, this.skinnedWorldObject.vertexPositions.Length / downResolution);
						break;
					case OVERFLOWMODEC.World:
						this.playgroundCache.targetPosition[p] = this.skinnedWorldObject.vertexPositions[num] + PlaygroundParticlesC.GetOverflow2(this.overflowOffset, p, this.skinnedWorldObject.vertexPositions.Length / downResolution);
						break;
					case OVERFLOWMODEC.SourcePoint:
						this.playgroundCache.targetPosition[p] = this.skinnedWorldObject.vertexPositions[num] + PlaygroundParticlesC.GetOverflow2(this.overflowOffset, this.skinnedWorldObject.normals[num], p, this.skinnedWorldObject.vertexPositions.Length / downResolution);
						break;
					}
				}
				break;
			}
			case SOURCEC.Paint:
				if (!this.overflow)
				{
					this.playgroundCache.targetPosition[p] = this.paint.GetPosition(p);
				}
				else
				{
					switch (this.overflowMode)
					{
					case OVERFLOWMODEC.SourceTransform:
						this.playgroundCache.targetPosition[p] = this.paint.GetPosition(p) + PlaygroundParticlesC.GetOverflow2(this.paint.GetRotation(p) * this.overflowOffset, p, this.paint.positionLength);
						break;
					case OVERFLOWMODEC.World:
						this.playgroundCache.targetPosition[p] = this.paint.GetPosition(p) + PlaygroundParticlesC.GetOverflow2(this.overflowOffset, p, this.paint.positionLength);
						break;
					case OVERFLOWMODEC.SourcePoint:
						this.playgroundCache.targetPosition[p] = this.paint.GetPosition(p) + this.paint.GetRotation(p) * PlaygroundParticlesC.GetOverflow2(this.overflowOffset, this.paint.GetNormal(p), p, this.paint.positionLength);
						break;
					}
				}
				break;
			case SOURCEC.Projection:
				if (!this.overflow)
				{
					this.playgroundCache.targetPosition[p] = this.projection.GetPosition(p);
				}
				else
				{
					switch (this.overflowMode)
					{
					case OVERFLOWMODEC.SourceTransform:
						this.playgroundCache.targetPosition[p] = this.projection.GetPosition(p) + PlaygroundParticlesC.GetOverflow2(this.stDir, p, this.projection.positionLength);
						break;
					case OVERFLOWMODEC.World:
						this.playgroundCache.targetPosition[p] = this.projection.GetPosition(p) + PlaygroundParticlesC.GetOverflow2(this.overflowOffset, p, this.projection.positionLength);
						break;
					case OVERFLOWMODEC.SourcePoint:
						this.playgroundCache.targetPosition[p] = this.projection.GetPosition(p) + PlaygroundParticlesC.GetOverflow2(PlaygroundParticlesC.Vector3Scale(this.stDir, this.projection.GetNormal(p)), p, this.projection.positionLength);
						break;
					}
				}
				break;
			case SOURCEC.Spline:
			{
				int index;
				if (this.treatAsOneSpline)
				{
					index = (int)((float)p * 1f / ((float)this.particleCount * 1f) * (float)this.splines.Count + this.splineTimeOffset) % this.splines.Count;
				}
				else
				{
					index = p % this.splines.Count;
				}
				float num2;
				if (this.treatAsOneSpline)
				{
					num2 = (float)(p * this.splines.Count) * 1f / ((float)this.particleCount * 1f) + this.splineTimeOffset;
				}
				else
				{
					num2 = (float)p * 1f / ((float)this.particleCount * 1f) + this.splineTimeOffset;
				}
				this.playgroundCache.targetPosition[p] = this.splines[index].GetPoint(num2);
				break;
			}
			}
			if (this.applySourceScatter)
			{
				this.playgroundCache.targetPosition[p] += Vector3.Scale(this.playgroundCache.scatterPosition[p], this.scatterScale);
			}
		}

		// Token: 0x06000941 RID: 2369 RVA: 0x0003AEFC File Offset: 0x000390FC
		public static void ThreadedCalculations(PlaygroundParticlesC playgroundParticles)
		{
			if (playgroundParticles.inPlayback)
			{
				playgroundParticles.isDoneThread = true;
				playgroundParticles.threadHadNoActiveParticles = false;
				return;
			}
			if (!playgroundParticles.isPrewarming)
			{
				playgroundParticles.localDeltaTime = (PlaygroundC.globalTime - playgroundParticles.lastTimeUpdated) * playgroundParticles.particleTimescale;
				playgroundParticles.localTime += playgroundParticles.localDeltaTime;
				playgroundParticles.lastTimeUpdated = PlaygroundC.globalTime;
			}
			playgroundParticles.t = playgroundParticles.localDeltaTime;
			if (playgroundParticles.particleCount <= 0 || playgroundParticles.playgroundCache.color.Length != playgroundParticles.particleCount || playgroundParticles.playgroundCache.targetPosition.Length != playgroundParticles.particleCount || playgroundParticles.playgroundCache.targetDirection.Length != playgroundParticles.particleCount || (playgroundParticles.source == SOURCEC.State && playgroundParticles.states[playgroundParticles.activeState].IsInitializing()) || playgroundParticles.isYieldRefreshing || !PlaygroundC.IsReady() || playgroundParticles.isSettingParticleTime)
			{
				playgroundParticles.isDoneThread = true;
				playgroundParticles.threadHadNoActiveParticles = false;
				return;
			}
			if (PlaygroundC.reference.calculate && playgroundParticles.calculate && !playgroundParticles.inTransition && playgroundParticles.hasActiveParticles)
			{
				if (!playgroundParticles.onlySourcePositioning && !playgroundParticles.onlyLifetimePositioning && playgroundParticles.turbulenceStrength > 0f && playgroundParticles.turbulenceType != TURBULENCETYPE.None && playgroundParticles.turbulenceType == TURBULENCETYPE.Simplex && playgroundParticles.turbulenceSimplex == null)
				{
					playgroundParticles.isDoneThread = true;
					playgroundParticles.threadHadNoActiveParticles = false;
					return;
				}
				float num = playgroundParticles.t;
				Matrix4x4 matrix4x = default(Matrix4x4);
				if (playgroundParticles.source == SOURCEC.State || playgroundParticles.source == SOURCEC.WorldObject || playgroundParticles.source == SOURCEC.SkinnedWorldObject)
				{
					matrix4x.SetTRS(Vector3.zero, playgroundParticles.stRot, new Vector3(1f, 1f, 1f));
				}
				bool flag = true;
				if (playgroundParticles.source == SOURCEC.Transform)
				{
					for (int i = 0; i < playgroundParticles.sourceTransforms.Count; i++)
					{
						playgroundParticles.sourceTransforms[i].UpdateMatrix();
					}
				}
				if (playgroundParticles.source == SOURCEC.SkinnedWorldObject && playgroundParticles.skinnedWorldObjectReady && !playgroundParticles.forceSkinnedMeshUpdateOnMainThread && PlaygroundC.reference.skinnedMeshThreadMethod == ThreadMethodComponent.InsideParticleCalculation)
				{
					playgroundParticles.skinnedWorldObject.Update();
				}
				int num2 = playgroundParticles.particleCache.Length;
				if (playgroundParticles.playgroundCache.lifetimeSubtraction.Length != num2)
				{
					PlaygroundParticlesC.SetLifetimeSubtraction(playgroundParticles);
				}
				if (playgroundParticles.playgroundCache.maskAlpha.Length != num2)
				{
					playgroundParticles.playgroundCache.maskAlpha = new float[num2];
					playgroundParticles.playgroundCache.isMasked = new bool[num2];
				}
				if (playgroundParticles.playgroundCache.manipulatorId.Length != num2)
				{
					playgroundParticles.playgroundCache.manipulatorId = new int[num2];
				}
				if (playgroundParticles.playgroundCache.excludeFromManipulatorId.Length != num2)
				{
					playgroundParticles.playgroundCache.excludeFromManipulatorId = new int[num2];
				}
				if (playgroundParticles.playgroundCache.noForce.Length != num2)
				{
					playgroundParticles.playgroundCache.noForce = new bool[num2];
				}
				if (playgroundParticles.playgroundCache.isNonBirthed.Length != num2)
				{
					playgroundParticles.playgroundCache.isNonBirthed = new bool[num2];
				}
				if (playgroundParticles.playgroundCache.isFirstLoop.Length != num2)
				{
					playgroundParticles.playgroundCache.isFirstLoop = new bool[num2];
				}
				if (playgroundParticles.playgroundCache.isCalculatedThisFrame.Length != num2)
				{
					playgroundParticles.playgroundCache.isCalculatedThisFrame = new bool[num2];
				}
				if (playgroundParticles.playgroundCache.simulate.Length != num2)
				{
					playgroundParticles.playgroundCache.simulate = new bool[num2];
					for (int j = 0; j < num2; j++)
					{
						playgroundParticles.playgroundCache.simulate[j] = true;
					}
				}
				bool flag2 = playgroundParticles.collision && playgroundParticles.lifetimeLoss > 0f;
				if (flag2 && (playgroundParticles.playgroundCache.lifetimeLoss == null || playgroundParticles.playgroundCache.lifetimeLoss.Length != num2))
				{
					playgroundParticles.playgroundCache.lifetimeLoss = new float[num2];
				}
				if (playgroundParticles.applyParticleMask && (playgroundParticles.playgroundCache.maskSorting == null || playgroundParticles.playgroundCache.maskSorting.Length != num2 || playgroundParticles.particleMaskSorting != playgroundParticles.previousMaskSorting))
				{
					playgroundParticles.RefreshMaskSorting();
				}
				Vector3 zero = Vector3.zero;
				Vector3 up = Vector3.up;
				float y = PlaygroundC.initialTargetPosition.y;
				for (int k = 0; k < playgroundParticles.particleCount; k++)
				{
					if (num2 != playgroundParticles.particleCache.Length || playgroundParticles.isYieldRefreshing || playgroundParticles.isSettingParticleTime || playgroundParticles.isSettingParticleCount)
					{
						playgroundParticles.cameFromNonEmissionFrame = false;
						playgroundParticles.isDoneThread = true;
						playgroundParticles.threadHadNoActiveParticles = false;
						return;
					}
					if (!playgroundParticles.playgroundCache.simulate[k])
					{
						if (playgroundParticles.playgroundCache.rebirth[k] && playgroundParticles.loop)
						{
							playgroundParticles.InactivateParticle(k);
						}
					}
					else
					{
						flag = false;
						playgroundParticles.playgroundCache.isCalculatedThisFrame[k] = false;
						float num3 = playgroundParticles.playgroundCache.death[k] - playgroundParticles.playgroundCache.birth[k] - playgroundParticles.playgroundCache.lifetimeSubtraction[k];
						float num4 = Mathf.Clamp01(playgroundParticles.playgroundCache.life[k] / num3);
						float normalizedP = (float)k * 1f / ((float)playgroundParticles.particleCount * 1f);
						float num5 = 1f;
						if (playgroundParticles.applyLifetimePositioningTimeScale)
						{
							num5 = playgroundParticles.lifetimePositioningTimeScale.Evaluate(num4);
						}
						if (playgroundParticles.applyParticleMask)
						{
							int num6 = playgroundParticles.playgroundCache.maskSorting[k];
							if (num6 >= 0 && num6 < playgroundParticles.particleCount)
							{
								if (k < playgroundParticles.particleMask)
								{
									if (playgroundParticles.playgroundCache.maskAlpha[num6] <= 0f || playgroundParticles.particleMaskTime <= 0f)
									{
										playgroundParticles.playgroundCache.isMasked[num6] = true;
										playgroundParticles.playgroundCache.maskAlpha[num6] = 0f;
										playgroundParticles.particleCache[num6].startSize = 0f;
									}
									else
									{
										playgroundParticles.playgroundCache.maskAlpha[num6] -= 1f / playgroundParticles.particleMaskTime * playgroundParticles.localDeltaTime;
									}
								}
								else if (playgroundParticles.playgroundCache.maskAlpha[num6] >= 1f || playgroundParticles.particleMaskTime <= 0f)
								{
									playgroundParticles.playgroundCache.isMasked[num6] = false;
									playgroundParticles.playgroundCache.maskAlpha[num6] = 1f;
								}
								else
								{
									playgroundParticles.playgroundCache.maskAlpha[num6] += 1f / playgroundParticles.particleMaskTime * playgroundParticles.localDeltaTime;
								}
							}
						}
						else
						{
							playgroundParticles.playgroundCache.isMasked[k] = false;
							playgroundParticles.playgroundCache.maskAlpha[k] = 1f;
						}
						Color32 particleColor = playgroundParticles.GetParticleColor(k, num4, normalizedP);
						playgroundParticles.SetParticleColorInternal(k, particleColor);
						playgroundParticles.playgroundCache.color[k] = particleColor;
						if (playgroundParticles.emit)
						{
							if (!playgroundParticles.syncPositionsOnMainThread)
							{
								playgroundParticles.playgroundCache.previousTargetPosition[k] = playgroundParticles.playgroundCache.targetPosition[k];
							}
							switch (playgroundParticles.source)
							{
							case SOURCEC.State:
								if (playgroundParticles.playgroundCache.rebirth[k] || playgroundParticles.onlySourcePositioning || playgroundParticles.onlyLifetimePositioning)
								{
									if (playgroundParticles.applyInitialLocalVelocity && !playgroundParticles.onlyLifetimePositioning)
									{
										playgroundParticles.playgroundCache.targetDirection[k] = matrix4x.MultiplyPoint3x4(PlaygroundParticlesC.Vector3Scale(playgroundParticles.playgroundCache.initialLocalVelocity[k], playgroundParticles.states[playgroundParticles.activeState].GetNormal(k)));
									}
									if (playgroundParticles.onlyLifetimePositioning)
									{
										playgroundParticles.playgroundCache.targetDirection[k] = matrix4x.MultiplyPoint3x4(PlaygroundParticlesC.Vector3Scale(playgroundParticles.lifetimePositioning.Evaluate(num4 * num5, playgroundParticles.lifetimePositioningScale), playgroundParticles.states[playgroundParticles.activeState].GetNormal(k)));
										if (playgroundParticles.applyLifetimePositioningPositionScale)
										{
											playgroundParticles.playgroundCache.targetDirection[k] *= playgroundParticles.lifetimePositioningPositionScale.Evaluate(num4);
										}
									}
									playgroundParticles.SetSourcePosition(k);
									if (playgroundParticles.localSpace && playgroundParticles.applyLocalSpaceMovementCompensation)
									{
										playgroundParticles.playgroundCache.localSpaceMovementCompensation[k] = playgroundParticles.playgroundCache.targetPosition[k] - playgroundParticles.playgroundCache.previousTargetPosition[k];
									}
								}
								break;
							case SOURCEC.Transform:
								if (playgroundParticles.playgroundCache.rebirth[k] || playgroundParticles.onlySourcePositioning || playgroundParticles.onlyLifetimePositioning)
								{
									if (playgroundParticles.applyInitialLocalVelocity && !playgroundParticles.onlyLifetimePositioning)
									{
										if (playgroundParticles.localSpace && playgroundParticles.transformIndex != playgroundParticles.psTransformNum)
										{
											playgroundParticles.playgroundCache.targetDirection[k] = playgroundParticles.particleSystemInverseRotation * playgroundParticles.sourceTransforms[playgroundParticles.transformIndex].rotation * playgroundParticles.playgroundCache.initialLocalVelocity[k];
										}
										else
										{
											playgroundParticles.playgroundCache.targetDirection[k] = playgroundParticles.sourceTransforms[playgroundParticles.transformIndex].rotation * playgroundParticles.playgroundCache.initialLocalVelocity[k];
										}
									}
									if (playgroundParticles.onlyLifetimePositioning)
									{
										playgroundParticles.playgroundCache.targetDirection[k] = playgroundParticles.sourceTransforms[playgroundParticles.transformIndex].rotation * playgroundParticles.lifetimePositioning.Evaluate(num4 * num5, playgroundParticles.lifetimePositioningScale);
										if (playgroundParticles.applyLifetimePositioningPositionScale)
										{
											playgroundParticles.playgroundCache.targetDirection[k] *= playgroundParticles.lifetimePositioningPositionScale.Evaluate(num4 * num5);
										}
									}
									playgroundParticles.SetSourcePosition(k);
									if (playgroundParticles.localSpace && playgroundParticles.applyLocalSpaceMovementCompensation)
									{
										playgroundParticles.playgroundCache.localSpaceMovementCompensation[k] = playgroundParticles.playgroundCache.targetPosition[k] - playgroundParticles.playgroundCache.previousTargetPosition[k];
									}
								}
								break;
							case SOURCEC.WorldObject:
								if (playgroundParticles.playgroundCache.rebirth[k] || playgroundParticles.onlySourcePositioning || playgroundParticles.onlyLifetimePositioning)
								{
									if (playgroundParticles.applyInitialLocalVelocity && !playgroundParticles.onlyLifetimePositioning)
									{
										playgroundParticles.playgroundCache.targetDirection[k] = matrix4x.MultiplyPoint3x4(PlaygroundParticlesC.Vector3Scale(playgroundParticles.playgroundCache.initialLocalVelocity[k], playgroundParticles.worldObject.normals[k % playgroundParticles.worldObject.normals.Length]));
									}
									if (playgroundParticles.onlyLifetimePositioning)
									{
										playgroundParticles.playgroundCache.targetDirection[k] = matrix4x.MultiplyPoint3x4(PlaygroundParticlesC.Vector3Scale(playgroundParticles.lifetimePositioning.Evaluate(num4 * num5, playgroundParticles.lifetimePositioningScale), playgroundParticles.worldObject.normals[k % playgroundParticles.worldObject.normals.Length]));
										if (playgroundParticles.applyLifetimePositioningPositionScale)
										{
											playgroundParticles.playgroundCache.targetDirection[k] *= playgroundParticles.lifetimePositioningPositionScale.Evaluate(num4);
										}
									}
									playgroundParticles.SetSourcePosition(k);
									if (playgroundParticles.localSpace && playgroundParticles.applyLocalSpaceMovementCompensation)
									{
										playgroundParticles.playgroundCache.localSpaceMovementCompensation[k] = playgroundParticles.playgroundCache.targetPosition[k] - playgroundParticles.playgroundCache.previousTargetPosition[k];
									}
								}
								break;
							case SOURCEC.SkinnedWorldObject:
								if (playgroundParticles.skinnedWorldObjectReady && (playgroundParticles.playgroundCache.rebirth[k] || playgroundParticles.onlySourcePositioning || playgroundParticles.onlyLifetimePositioning))
								{
									if (playgroundParticles.applyInitialLocalVelocity && !playgroundParticles.onlyLifetimePositioning)
									{
										playgroundParticles.playgroundCache.targetDirection[k] = matrix4x.MultiplyPoint3x4(PlaygroundParticlesC.Vector3Scale(playgroundParticles.playgroundCache.initialLocalVelocity[k], playgroundParticles.skinnedWorldObject.normals[k % playgroundParticles.skinnedWorldObject.normals.Length]));
									}
									if (playgroundParticles.onlyLifetimePositioning)
									{
										playgroundParticles.playgroundCache.targetDirection[k] = matrix4x.MultiplyPoint3x4(PlaygroundParticlesC.Vector3Scale(playgroundParticles.lifetimePositioning.Evaluate(num4 * num5, playgroundParticles.lifetimePositioningScale), playgroundParticles.skinnedWorldObject.normals[k % playgroundParticles.skinnedWorldObject.normals.Length]));
										if (playgroundParticles.applyLifetimePositioningPositionScale)
										{
											playgroundParticles.playgroundCache.targetDirection[k] *= playgroundParticles.lifetimePositioningPositionScale.Evaluate(num4);
										}
									}
									playgroundParticles.SetSourcePosition(k);
									if (playgroundParticles.localSpace && playgroundParticles.applyLocalSpaceMovementCompensation)
									{
										playgroundParticles.playgroundCache.localSpaceMovementCompensation[k] = playgroundParticles.playgroundCache.targetPosition[k] - playgroundParticles.playgroundCache.previousTargetPosition[k];
									}
								}
								break;
							case SOURCEC.Paint:
								if (playgroundParticles.playgroundCache.rebirth[k] || playgroundParticles.onlySourcePositioning || playgroundParticles.onlyLifetimePositioning)
								{
									if (playgroundParticles.applyInitialLocalVelocity && !playgroundParticles.onlyLifetimePositioning)
									{
										playgroundParticles.playgroundCache.targetDirection[k] = playgroundParticles.paint.GetRotation(k) * PlaygroundParticlesC.Vector3Scale(playgroundParticles.playgroundCache.initialLocalVelocity[k], playgroundParticles.paint.GetNormal(k));
									}
									if (playgroundParticles.onlyLifetimePositioning)
									{
										playgroundParticles.playgroundCache.targetDirection[k] = playgroundParticles.paint.GetRotation(k) * PlaygroundParticlesC.Vector3Scale(playgroundParticles.lifetimePositioning.Evaluate(num4 * num5, playgroundParticles.lifetimePositioningScale), playgroundParticles.paint.GetNormal(k));
										if (playgroundParticles.applyLifetimePositioningPositionScale)
										{
											playgroundParticles.playgroundCache.targetDirection[k] *= playgroundParticles.lifetimePositioningPositionScale.Evaluate(num4);
										}
									}
									playgroundParticles.SetSourcePosition(k);
									if (playgroundParticles.localSpace && playgroundParticles.applyLocalSpaceMovementCompensation)
									{
										playgroundParticles.playgroundCache.localSpaceMovementCompensation[k] = playgroundParticles.playgroundCache.targetPosition[k] - playgroundParticles.playgroundCache.previousTargetPosition[k];
									}
								}
								break;
							case SOURCEC.Projection:
								if (playgroundParticles.playgroundCache.rebirth[k] || playgroundParticles.onlySourcePositioning || playgroundParticles.onlyLifetimePositioning)
								{
									if (playgroundParticles.applyInitialLocalVelocity && !playgroundParticles.onlyLifetimePositioning)
									{
										playgroundParticles.playgroundCache.targetDirection[k] = PlaygroundParticlesC.Vector3Scale(playgroundParticles.projection.GetNormal(k), playgroundParticles.playgroundCache.initialLocalVelocity[k]);
									}
									if (playgroundParticles.onlyLifetimePositioning)
									{
										playgroundParticles.playgroundCache.targetDirection[k] = PlaygroundParticlesC.Vector3Scale(playgroundParticles.projection.GetNormal(k), playgroundParticles.lifetimePositioning.Evaluate(num4 * num5, playgroundParticles.lifetimePositioningScale));
										if (playgroundParticles.applyLifetimePositioningPositionScale)
										{
											playgroundParticles.playgroundCache.targetDirection[k] *= playgroundParticles.lifetimePositioningPositionScale.Evaluate(num4);
										}
									}
									playgroundParticles.SetSourcePosition(k);
								}
								break;
							case SOURCEC.Spline:
								if (playgroundParticles.playgroundCache.rebirth[k] || playgroundParticles.onlySourcePositioning || playgroundParticles.onlyLifetimePositioning)
								{
									if (playgroundParticles.treatAsOneSpline)
									{
										playgroundParticles.splineIndex = (int)((float)k * 1f / ((float)num2 * 1f) * (float)playgroundParticles.splines.Count + playgroundParticles.splineTimeOffset) % playgroundParticles.splines.Count;
									}
									else
									{
										playgroundParticles.splineIndex = k % playgroundParticles.splines.Count;
									}
									float num7;
									if (playgroundParticles.treatAsOneSpline)
									{
										num7 = (float)(k * playgroundParticles.splines.Count) * 1f / ((float)num2 * 1f) + playgroundParticles.splineTimeOffset;
									}
									else
									{
										num7 = (float)k * 1f / ((float)num2 * 1f) + playgroundParticles.splineTimeOffset;
									}
									if (playgroundParticles.applyInitialLocalVelocity && !playgroundParticles.onlyLifetimePositioning)
									{
										playgroundParticles.playgroundCache.targetDirection[k] = PlaygroundParticlesC.Vector3Scale(playgroundParticles.splines[playgroundParticles.splineIndex].GetDirection(num7), playgroundParticles.playgroundCache.initialLocalVelocity[k]);
									}
									if (playgroundParticles.onlyLifetimePositioning)
									{
										playgroundParticles.playgroundCache.targetDirection[k] = PlaygroundParticlesC.Vector3Scale(playgroundParticles.splines[playgroundParticles.splineIndex].GetDirection(num7), playgroundParticles.lifetimePositioning.Evaluate(num4 * num5, playgroundParticles.lifetimePositioningScale));
										if (playgroundParticles.applyLifetimePositioningPositionScale)
										{
											playgroundParticles.playgroundCache.targetDirection[k] *= playgroundParticles.lifetimePositioningPositionScale.Evaluate(num4 * num5);
										}
									}
									playgroundParticles.playgroundCache.targetPosition[k] = playgroundParticles.splines[playgroundParticles.splineIndex].GetPoint(num7);
									if (playgroundParticles.applySourceScatter)
									{
										playgroundParticles.playgroundCache.targetPosition[k] += Vector3.Scale(playgroundParticles.playgroundCache.scatterPosition[k], playgroundParticles.scatterScale);
									}
									if (playgroundParticles.localSpace && playgroundParticles.applyLocalSpaceMovementCompensation)
									{
										playgroundParticles.playgroundCache.localSpaceMovementCompensation[k] = playgroundParticles.playgroundCache.targetPosition[k] - playgroundParticles.playgroundCache.previousTargetPosition[k];
									}
								}
								break;
							}
						}
						if (playgroundParticles.playgroundCache.life[k] == 0f)
						{
							if (!playgroundParticles.onlyLifetimePositioning)
							{
								playgroundParticles.playgroundCache.position[k] = playgroundParticles.playgroundCache.targetPosition[k];
								if (playgroundParticles.applyDeltaOnRebirth && !playgroundParticles.cameFromNonEmissionFrame && playgroundParticles.localTime - playgroundParticles.emissionStopped > playgroundParticles.lifetime && playgroundParticles.playgroundCache.birthDelay[k] == 0f && !playgroundParticles.onlySourcePositioning)
								{
									float num8 = playgroundParticles.localTime - playgroundParticles.playgroundCache.birth[k];
									if (playgroundParticles.isPrewarming)
									{
										num8 *= 0.5f;
									}
									playgroundParticles.playgroundCache.position[k] += playgroundParticles.playgroundCache.velocity[k] * playgroundParticles.velocityScale * num8;
								}
							}
							playgroundParticles.playgroundCache.initialColor[k] = particleColor;
							if (!playgroundParticles.cameFromNonEmissionFrame && playgroundParticles.calculateDeltaMovement && !playgroundParticles.isPrewarming && playgroundParticles.source != SOURCEC.Script)
							{
								Vector3 a = playgroundParticles.playgroundCache.targetPosition[k] - playgroundParticles.playgroundCache.previousTargetPosition[k];
								if (playgroundParticles.deltaMovementStrengthValueMethod == VALUEMETHOD.Constant)
								{
									playgroundParticles.playgroundCache.velocity[k] += a * playgroundParticles.deltaMovementStrength / playgroundParticles.realSimulationTime;
								}
								else
								{
									playgroundParticles.playgroundCache.velocity[k] += a * PlaygroundParticlesC.RandomRange(playgroundParticles.internalRandom01, playgroundParticles.deltaMovementStrength, playgroundParticles.minDeltaMovementStrength) / playgroundParticles.realSimulationTime;
								}
							}
							playgroundParticles.playgroundCache.birthDelay[k] = 0f;
						}
						if (playgroundParticles.playgroundCache.birth[k] > playgroundParticles.localTime)
						{
							playgroundParticles.particleCache[k].startSize = 0f;
							playgroundParticles.playgroundCache.position[k] = PlaygroundC.initialTargetPosition;
						}
						if (playgroundParticles.playgroundCache.rebirth[k])
						{
							if (playgroundParticles.playgroundCache.birth[k] + playgroundParticles.playgroundCache.life[k] <= playgroundParticles.localTime + num3 && (!playgroundParticles.playgroundCache.isNonBirthed[k] || playgroundParticles.onlyLifetimePositioning || playgroundParticles.onlySourcePositioning))
							{
								if (!playgroundParticles.playgroundCache.changedByPropertySize[k])
								{
									if (playgroundParticles.applyLifetimeSize && !playgroundParticles.applyParticleArraySize)
									{
										playgroundParticles.playgroundCache.size[k] = playgroundParticles.playgroundCache.initialSize[k] * playgroundParticles.lifetimeSize.Evaluate(num4) * playgroundParticles.scale;
									}
									else if (playgroundParticles.applyLifetimeSize && playgroundParticles.applyParticleArraySize)
									{
										playgroundParticles.playgroundCache.size[k] = playgroundParticles.playgroundCache.initialSize[k] * playgroundParticles.lifetimeSize.Evaluate(num4) * playgroundParticles.particleArraySize.Evaluate((float)k * 1f / ((float)playgroundParticles.particleCount * 1f)) * playgroundParticles.scale;
									}
									else if (playgroundParticles.applyParticleArraySize)
									{
										playgroundParticles.playgroundCache.size[k] = playgroundParticles.playgroundCache.initialSize[k] * playgroundParticles.particleArraySize.Evaluate((float)k * 1f / ((float)playgroundParticles.particleCount * 1f)) * playgroundParticles.scale;
									}
									else
									{
										playgroundParticles.playgroundCache.size[k] = playgroundParticles.playgroundCache.initialSize[k] * playgroundParticles.scale;
									}
								}
								if (!playgroundParticles.onlySourcePositioning && !playgroundParticles.onlyLifetimePositioning)
								{
									if (playgroundParticles.hasCollisionCache && playgroundParticles.stickyCollisions && playgroundParticles.collisionCache.hasCollided[k] && !playgroundParticles.playgroundCache.isNonBirthed[k])
									{
										if (playgroundParticles.stickyCollisionsSurfaceOffset == 0f)
										{
											playgroundParticles.playgroundCache.position[k] = playgroundParticles.collisionCache.stickyPosition[k];
										}
										else
										{
											playgroundParticles.playgroundCache.position[k] = playgroundParticles.collisionCache.stickyPosition[k] + playgroundParticles.collisionCache.collisionNormal[k] * playgroundParticles.stickyCollisionsSurfaceOffset;
										}
									}
									else if (!playgroundParticles.playgroundCache.noForce[k] && playgroundParticles.playgroundCache.life[k] > 0f)
									{
										if (playgroundParticles.applyVelocityBending)
										{
											if (playgroundParticles.velocityBendingType == VELOCITYBENDINGTYPEC.SourcePosition)
											{
												playgroundParticles.playgroundCache.velocity[k] += Vector3.Reflect(new Vector3(playgroundParticles.playgroundCache.velocity[k].x * playgroundParticles.velocityBending.x, playgroundParticles.playgroundCache.velocity[k].y * playgroundParticles.velocityBending.y, playgroundParticles.playgroundCache.velocity[k].z * playgroundParticles.velocityBending.z), (playgroundParticles.playgroundCache.targetPosition[k] - playgroundParticles.playgroundCache.position[k]).normalized) * num;
											}
											else
											{
												playgroundParticles.playgroundCache.velocity[k] += Vector3.Reflect(new Vector3(playgroundParticles.playgroundCache.velocity[k].x * playgroundParticles.velocityBending.x, playgroundParticles.playgroundCache.velocity[k].y * playgroundParticles.velocityBending.y, playgroundParticles.playgroundCache.velocity[k].z * playgroundParticles.velocityBending.z), (playgroundParticles.playgroundCache.previousParticlePosition[k] - playgroundParticles.playgroundCache.position[k]).normalized) * num;
											}
										}
										playgroundParticles.playgroundCache.previousTargetPosition[k] = playgroundParticles.playgroundCache.targetPosition[k];
										if (playgroundParticles.localSpace && playgroundParticles.source == SOURCEC.Transform && playgroundParticles.transformIndex != playgroundParticles.psTransformNum)
										{
											playgroundParticles.playgroundCache.velocity[k] -= playgroundParticles.sourceTransforms[playgroundParticles.transformIndex].rotation * playgroundParticles.gravity * num;
										}
										else
										{
											playgroundParticles.playgroundCache.velocity[k] -= playgroundParticles.gravity * num;
										}
										if (playgroundParticles.applyLifetimeVelocity)
										{
											playgroundParticles.playgroundCache.velocity[k] += playgroundParticles.lifetimeVelocity.Evaluate(num4, playgroundParticles.lifetimeVelocityScale) * num;
										}
										if (playgroundParticles.HasTurbulence() && PlaygroundC.reference.turbulenceThreadMethod == ThreadMethodComponent.InsideParticleCalculation && !playgroundParticles.playgroundCache.noForce[k])
										{
											PlaygroundParticlesC.Turbulence(playgroundParticles, playgroundParticles.turbulenceSimplex, k, playgroundParticles.t, playgroundParticles.turbulenceType, playgroundParticles.turbulenceTimeScale, playgroundParticles.turbulenceScale / playgroundParticles.velocityScale, playgroundParticles.turbulenceStrength, playgroundParticles.turbulenceApplyLifetimeStrength, playgroundParticles.turbulenceLifetimeStrength);
										}
										if (playgroundParticles.playgroundCache.velocity[k].sqrMagnitude > playgroundParticles.maxVelocity)
										{
											playgroundParticles.playgroundCache.velocity[k] = Vector3.ClampMagnitude(playgroundParticles.playgroundCache.velocity[k], playgroundParticles.maxVelocity);
										}
										if (playgroundParticles.damping > 0f)
										{
											playgroundParticles.playgroundCache.velocity[k] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[k], zero, playgroundParticles.damping * num);
										}
										if (playgroundParticles.transitionBackToSource)
										{
											float num9 = playgroundParticles.transitionBackToSourceAmount.Evaluate(num4) * playgroundParticles.particleTimescale;
											playgroundParticles.playgroundCache.position[k] = Vector3.Lerp(playgroundParticles.playgroundCache.position[k], playgroundParticles.playgroundCache.targetPosition[k], num9);
											playgroundParticles.playgroundCache.velocity[k] *= 1f - num9;
										}
										if (playgroundParticles.axisConstraints.x)
										{
											playgroundParticles.playgroundCache.velocity[k].x = 0f;
										}
										if (playgroundParticles.axisConstraints.y)
										{
											playgroundParticles.playgroundCache.velocity[k].y = 0f;
										}
										if (playgroundParticles.axisConstraints.z)
										{
											playgroundParticles.playgroundCache.velocity[k].z = 0f;
										}
										playgroundParticles.playgroundCache.collisionParticlePosition[k] = playgroundParticles.playgroundCache.position[k];
										playgroundParticles.playgroundCache.position[k] += playgroundParticles.playgroundCache.velocity[k] * playgroundParticles.velocityScale * num;
										if (playgroundParticles.localSpace && playgroundParticles.applyLocalSpaceMovementCompensation)
										{
											if (!playgroundParticles.applyMovementCompensationLifetimeStrength)
											{
												playgroundParticles.playgroundCache.position[k] += playgroundParticles.playgroundCache.localSpaceMovementCompensation[k];
											}
											else
											{
												playgroundParticles.playgroundCache.position[k] += playgroundParticles.playgroundCache.localSpaceMovementCompensation[k] * playgroundParticles.movementCompensationLifetimeStrength.Evaluate(num4);
											}
										}
										if (playgroundParticles.renderModeStretch && playgroundParticles.realSimulationTime > 0f)
										{
											if (playgroundParticles.applyLifetimeStretching)
											{
												playgroundParticles.particleCache[k].velocity = Vector3.Slerp(playgroundParticles.particleCache[k].velocity, (playgroundParticles.playgroundCache.position[k] - playgroundParticles.playgroundCache.previousParticlePosition[k]) * playgroundParticles.stretchLifetime.Evaluate(playgroundParticles.playgroundCache.life[k] / num3) / playgroundParticles.realSimulationTime, num * playgroundParticles.stretchSpeed * playgroundParticles.realSimulationTime);
											}
											else if (playgroundParticles.stretchSpeed > 0f)
											{
												playgroundParticles.particleCache[k].velocity = Vector3.Slerp(playgroundParticles.particleCache[k].velocity, (playgroundParticles.playgroundCache.position[k] - playgroundParticles.playgroundCache.previousParticlePosition[k]) / playgroundParticles.realSimulationTime, num * playgroundParticles.stretchSpeed * playgroundParticles.realSimulationTime);
											}
											else
											{
												playgroundParticles.particleCache[k].velocity = playgroundParticles.stretchStartDirection;
											}
										}
									}
								}
								else
								{
									if (playgroundParticles.onlyLifetimePositioning && !playgroundParticles.onlySourcePositioning)
									{
										if (!playgroundParticles.playgroundCache.changedByPropertyTarget[k])
										{
											if (playgroundParticles.lifetimePositioningUsesSourceDirection && playgroundParticles.source != SOURCEC.Script)
											{
												playgroundParticles.playgroundCache.position[k] = playgroundParticles.playgroundCache.targetPosition[k] + playgroundParticles.playgroundCache.targetDirection[k];
											}
											else if (!playgroundParticles.applyLifetimePositioningPositionScale)
											{
												playgroundParticles.playgroundCache.position[k] = playgroundParticles.playgroundCache.targetPosition[k] + playgroundParticles.lifetimePositioning.Evaluate(num4 * num5, playgroundParticles.lifetimePositioningScale);
											}
											else
											{
												playgroundParticles.playgroundCache.position[k] = playgroundParticles.playgroundCache.targetPosition[k] + playgroundParticles.lifetimePositioning.Evaluate(num4 * num5, playgroundParticles.lifetimePositioningScale) * playgroundParticles.lifetimePositioningPositionScale.Evaluate(num4 * num5);
											}
										}
									}
									else if (playgroundParticles.source != SOURCEC.Script && !playgroundParticles.playgroundCache.isNonBirthed[k])
									{
										playgroundParticles.playgroundCache.position[k] = playgroundParticles.playgroundCache.targetPosition[k];
									}
									if (playgroundParticles.renderModeStretch && playgroundParticles.realSimulationTime > 0f)
									{
										if (playgroundParticles.applyLifetimeStretching)
										{
											playgroundParticles.particleCache[k].velocity = Vector3.Slerp(playgroundParticles.particleCache[k].velocity, (playgroundParticles.playgroundCache.position[k] - playgroundParticles.playgroundCache.previousParticlePosition[k]) / playgroundParticles.realSimulationTime, num * playgroundParticles.stretchSpeed) * playgroundParticles.stretchLifetime.Evaluate(playgroundParticles.playgroundCache.life[k] / num3);
										}
										else if (playgroundParticles.stretchSpeed > 0f)
										{
											playgroundParticles.particleCache[k].velocity = Vector3.Slerp(playgroundParticles.particleCache[k].velocity, (playgroundParticles.playgroundCache.position[k] - playgroundParticles.playgroundCache.previousParticlePosition[k]) / playgroundParticles.realSimulationTime, num * playgroundParticles.stretchSpeed);
										}
										else
										{
											playgroundParticles.particleCache[k].velocity = playgroundParticles.stretchStartDirection;
										}
									}
									playgroundParticles.playgroundCache.previousTargetPosition[k] = playgroundParticles.playgroundCache.targetPosition[k];
								}
								if (num != 0f)
								{
									if (!playgroundParticles.rotateTowardsDirection)
									{
										playgroundParticles.playgroundCache.rotation[k] += playgroundParticles.playgroundCache.rotationSpeed[k] * num;
									}
									else if (playgroundParticles.playgroundCache.life[k] != 0f && playgroundParticles.playgroundCache.position[k] - playgroundParticles.playgroundCache.previousParticlePosition[k] != Vector3.zero)
									{
										playgroundParticles.playgroundCache.rotation[k] = playgroundParticles.playgroundCache.initialRotation[k] + PlaygroundParticlesC.SignedAngle(up, playgroundParticles.playgroundCache.position[k] - playgroundParticles.playgroundCache.previousParticlePosition[k], playgroundParticles.rotationNormal);
									}
								}
								if (!playgroundParticles.syncPositionsOnMainThread && playgroundParticles.playgroundCache.life[k] > 0f)
								{
									playgroundParticles.particleCache[k].rotation = playgroundParticles.playgroundCache.rotation[k];
								}
								playgroundParticles.playgroundCache.previousParticlePosition[k] = playgroundParticles.playgroundCache.position[k];
								if (playgroundParticles.hasTimerEvent)
								{
									playgroundParticles.SendEvent(EVENTTYPEC.Time, k);
								}
							}
							else
							{
								playgroundParticles.particleCache[k].startSize = 0f;
								playgroundParticles.playgroundCache.position[k] = PlaygroundC.initialTargetPosition;
							}
							float num10 = (playgroundParticles.localTime - playgroundParticles.playgroundCache.birth[k]) / num3;
							if (playgroundParticles.playgroundCache.life[k] < playgroundParticles.playgroundCache.death[k] - playgroundParticles.playgroundCache.birth[k])
							{
								playgroundParticles.playgroundCache.life[k] = num3 * num10;
								if (flag2)
								{
									playgroundParticles.playgroundCache.life[k] += playgroundParticles.playgroundCache.lifetimeLoss[k];
									playgroundParticles.playgroundCache.lifetimeLoss[k] = 0f;
								}
								if (!playgroundParticles.syncPositionsOnMainThread)
								{
									playgroundParticles.particleCache[k].lifetime = Mathf.Clamp(num3 * (1f - num10), playgroundParticles.minShurikenLifetime, playgroundParticles.playgroundCache.death[k] - playgroundParticles.playgroundCache.birth[k]);
								}
								if (playgroundParticles.lifetimeValueMethod == VALUEMETHOD.RandomBetweenTwoValues && playgroundParticles.playgroundCache.life[k] > num3)
								{
									if ((playgroundParticles.hasEvent || playgroundParticles.hasEventManipulatorGlobal || playgroundParticles.hasEventManipulatorLocal) && !playgroundParticles.playgroundCache.isNonBirthed[k])
									{
										PlaygroundParticlesC.SendDeathEvents(playgroundParticles, k);
									}
									playgroundParticles.particleCache[k].startSize = 0f;
									playgroundParticles.particleCache[k].velocity = zero;
									playgroundParticles.playgroundCache.position[k] = PlaygroundC.initialTargetPosition;
								}
							}
							else
							{
								if (!playgroundParticles.loop && !playgroundParticles.playgroundCache.isNonBirthed[k])
								{
									if (playgroundParticles.hasEvent || playgroundParticles.hasEventManipulatorGlobal || playgroundParticles.hasEventManipulatorLocal)
									{
										PlaygroundParticlesC.SendDeathEvents(playgroundParticles, k);
									}
									playgroundParticles.InactivateParticle(k);
									goto IL_3BE5;
								}
								if (!playgroundParticles.loop && playgroundParticles.localTime > playgroundParticles.simulationStarted + (playgroundParticles.playgroundCache.death[k] - playgroundParticles.playgroundCache.birth[k]) - 0.01f)
								{
									playgroundParticles.loopExceeded = true;
									if (playgroundParticles.loopExceededOnParticle == k && num10 > 2f)
									{
										if (playgroundParticles.disableOnDone)
										{
											playgroundParticles.queueEmissionHalt = true;
										}
										playgroundParticles.threadHadNoActiveParticles = true;
										playgroundParticles.hasActiveParticles = false;
									}
									if (playgroundParticles.loopExceededOnParticle == -1)
									{
										playgroundParticles.loopExceededOnParticle = k;
									}
								}
								playgroundParticles.particleCache[k].velocity = zero;
								if ((playgroundParticles.hasEvent || playgroundParticles.hasEventManipulatorGlobal || playgroundParticles.hasEventManipulatorLocal) && !playgroundParticles.playgroundCache.isNonBirthed[k])
								{
									PlaygroundParticlesC.SendDeathEvents(playgroundParticles, k);
								}
								if (playgroundParticles.localTime < playgroundParticles.playgroundCache.birth[k] + playgroundParticles.playgroundCache.birthDelay[k] || playgroundParticles.loopExceeded || playgroundParticles.source == SOURCEC.Script || !playgroundParticles.emit)
								{
									playgroundParticles.InactivateParticle(k);
									goto IL_3BE5;
								}
								if (!playgroundParticles.playgroundCache.changedByPropertyDeath[k] || (playgroundParticles.playgroundCache.changedByPropertyDeath[k] && playgroundParticles.localTime > playgroundParticles.playgroundCache.death[k]))
								{
									PlaygroundParticlesC.Rebirth(playgroundParticles, k, playgroundParticles.internalRandom01);
								}
								else
								{
									playgroundParticles.particleCache[k].velocity = zero;
									playgroundParticles.particleCache[k].startSize = 0f;
									playgroundParticles.playgroundCache.position[k] = PlaygroundC.initialTargetPosition;
								}
							}
							for (int l = 0; l < playgroundParticles.manipulators.Count; l++)
							{
								PlaygroundParticlesC.CalculateManipulator(playgroundParticles, playgroundParticles.manipulators[l], k, num, playgroundParticles.playgroundCache.life[k], playgroundParticles.playgroundCache.position[k], ((!playgroundParticles.localSpace) ? playgroundParticles.manipulators[l].transform.position : playgroundParticles.manipulators[l].transform.localPosition) + playgroundParticles.manipulatorFix, playgroundParticles.localSpace);
							}
							if (playgroundParticles.hasGlobalAffectingManipulators)
							{
								for (int m = 0; m < PlaygroundC.reference.manipulators.Count; m++)
								{
									if ((PlaygroundC.reference.manipulators[m].affects.value & 1 << playgroundParticles.GetLayer()) != 0)
									{
										PlaygroundParticlesC.CalculateManipulator(playgroundParticles, PlaygroundC.reference.manipulators[m], k, num, playgroundParticles.playgroundCache.life[k], playgroundParticles.playgroundCache.position[k], ((!playgroundParticles.localSpace) ? PlaygroundC.reference.manipulators[m].transform.position : PlaygroundC.reference.manipulators[m].transform.localPosition) + playgroundParticles.manipulatorFix, playgroundParticles.localSpace);
									}
								}
							}
							if (!playgroundParticles.syncPositionsOnMainThread)
							{
								playgroundParticles.particleCache[k].startSize = ((playgroundParticles.playgroundCache.maskAlpha[k] <= 0f || playgroundParticles.particleCache[k].position.y == y) ? 0f : playgroundParticles.playgroundCache.size[k]);
							}
						}
						else
						{
							playgroundParticles.InactivateParticle(k);
						}
						if (!playgroundParticles.syncPositionsOnMainThread)
						{
							playgroundParticles.particleCache[k].position = playgroundParticles.playgroundCache.position[k];
						}
						playgroundParticles.playgroundCache.isCalculatedThisFrame[k] = true;
					}
					IL_3BE5:;
				}
				if (playgroundParticles.isSettingParticleTime)
				{
					playgroundParticles.threadHadNoActiveParticles = false;
				}
				else
				{
					playgroundParticles.threadHadNoActiveParticles = ((flag && !playgroundParticles.emit) || (flag && !playgroundParticles.loop));
				}
				playgroundParticles.cameFromNonEmissionFrame = false;
				playgroundParticles.isDoneThread = true;
				if (playgroundParticles.HasTurbulence() && PlaygroundC.reference.turbulenceThreadMethod == ThreadMethodComponent.OnePerSystem)
				{
					PlaygroundC.RunAsync(delegate()
					{
						for (int n = 0; n < playgroundParticles.particleCount; n++)
						{
							if (!playgroundParticles.playgroundCache.noForce[n])
							{
								PlaygroundParticlesC.Turbulence(playgroundParticles, playgroundParticles.turbulenceSimplex, n, playgroundParticles.t, playgroundParticles.turbulenceType, playgroundParticles.turbulenceTimeScale, playgroundParticles.turbulenceScale / playgroundParticles.velocityScale, playgroundParticles.turbulenceStrength, playgroundParticles.turbulenceApplyLifetimeStrength, playgroundParticles.turbulenceLifetimeStrength);
							}
						}
					});
				}
				return;
			}
			else
			{
				if (playgroundParticles.source != SOURCEC.Script)
				{
					playgroundParticles.isDoneThread = true;
					playgroundParticles.cameFromNonCalculatedFrame = true;
					return;
				}
				playgroundParticles.isDoneThread = true;
				return;
			}
		}

		// Token: 0x06000942 RID: 2370 RVA: 0x0003EBB8 File Offset: 0x0003CDB8
		public static void SendDeathEvents(PlaygroundParticlesC playgroundParticles, int p)
		{
			if ((playgroundParticles.playgroundCache.life[p] > 0f || playgroundParticles.playgroundCache.changedByPropertyDeath[p]) && !playgroundParticles.playgroundCache.isNonBirthed[p] && (playgroundParticles.loop || (!playgroundParticles.loop && playgroundParticles.playgroundCache.isFirstLoop[p])))
			{
				playgroundParticles.SendEvent(EVENTTYPEC.Death, p);
			}
			if (playgroundParticles.hasEventManipulatorLocal)
			{
				for (int i = 0; i < playgroundParticles.manipulators.Count; i++)
				{
					if (playgroundParticles.manipulators[i].trackParticles && playgroundParticles.manipulators[i].RemoveParticle(playgroundParticles.particleSystemId, p) && playgroundParticles.manipulators[i].sendEventDeath)
					{
						playgroundParticles.UpdateEventParticle(playgroundParticles.manipulators[i].manipulatorEventParticle, p);
						playgroundParticles.manipulators[i].SendParticleEventDeath();
					}
				}
			}
			if (playgroundParticles.hasEventManipulatorGlobal)
			{
				for (int j = 0; j < PlaygroundC.reference.manipulators.Count; j++)
				{
					if (PlaygroundC.reference.manipulators[j].trackParticles && PlaygroundC.reference.manipulators[j].RemoveParticle(playgroundParticles.particleSystemId, p) && PlaygroundC.reference.manipulators[j].sendEventDeath)
					{
						playgroundParticles.UpdateEventParticle(PlaygroundC.reference.manipulators[j].manipulatorEventParticle, p);
						PlaygroundC.reference.manipulators[j].SendParticleEventDeath();
					}
				}
			}
			playgroundParticles.playgroundCache.isNonBirthed[p] = true;
		}

		// Token: 0x06000943 RID: 2371 RVA: 0x0003ED8C File Offset: 0x0003CF8C
		public static void Turbulence(PlaygroundParticlesC playgroundParticles, SimplexNoise turbulenceSimplex, int p, float t, TURBULENCETYPE turbulenceType, float turbulenceTimeScale, float turbulenceScale, float turbulenceStrength, bool turbulenceApplyLifetimeStrength, AnimationCurve turbulenceLifetimeStrength)
		{
			if (!playgroundParticles.calculate || playgroundParticles.inPlayback)
			{
				return;
			}
			float num = 1f;
			float num2 = 1f;
			float num3 = 2f;
			float num4 = 3f;
			if (playgroundParticles.playgroundCache.simulate[p] && playgroundParticles.playgroundCache.position[p].y != PlaygroundC.initialTargetPosition.y)
			{
				if (turbulenceType == TURBULENCETYPE.Simplex)
				{
					if (turbulenceTimeScale > 0f)
					{
						if (playgroundParticles.turbulenceApplyLifetimeStrength)
						{
							num = playgroundParticles.turbulenceLifetimeStrength.Evaluate(Mathf.Clamp01(playgroundParticles.playgroundCache.life[p] / (playgroundParticles.playgroundCache.death[p] - playgroundParticles.playgroundCache.birth[p] - playgroundParticles.playgroundCache.lifetimeSubtraction[p])));
						}
						if (num > 0f)
						{
							if (!playgroundParticles.axisConstraints.x)
							{
								Vector3[] velocity = playgroundParticles.playgroundCache.velocity;
								velocity[p].x = velocity[p].x + (float)turbulenceSimplex.noise((double)((playgroundParticles.playgroundCache.position[p].x + num2) * turbulenceScale), (double)((playgroundParticles.playgroundCache.position[p].y + num3) * turbulenceScale), (double)((playgroundParticles.playgroundCache.position[p].z + num4) * turbulenceScale), (double)(playgroundParticles.localTime * turbulenceTimeScale)) * turbulenceStrength * t * num;
							}
							if (!playgroundParticles.axisConstraints.y)
							{
								Vector3[] velocity2 = playgroundParticles.playgroundCache.velocity;
								velocity2[p].y = velocity2[p].y + (float)turbulenceSimplex.noise((double)((playgroundParticles.playgroundCache.position[p].y + num3) * turbulenceScale), (double)((playgroundParticles.playgroundCache.position[p].x + num2) * turbulenceScale), (double)((playgroundParticles.playgroundCache.position[p].z + num4) * turbulenceScale), (double)(playgroundParticles.localTime * turbulenceTimeScale)) * turbulenceStrength * t * num;
							}
							if (!playgroundParticles.axisConstraints.z)
							{
								Vector3[] velocity3 = playgroundParticles.playgroundCache.velocity;
								velocity3[p].z = velocity3[p].z + (float)turbulenceSimplex.noise((double)((playgroundParticles.playgroundCache.position[p].z + num4) * turbulenceScale), (double)((playgroundParticles.playgroundCache.position[p].x + num2) * turbulenceScale), (double)((playgroundParticles.playgroundCache.position[p].y + num3) * turbulenceScale), (double)(playgroundParticles.localTime * turbulenceTimeScale)) * turbulenceStrength * t * num;
							}
						}
					}
					else if (num > 0f)
					{
						if (!playgroundParticles.axisConstraints.x)
						{
							Vector3[] velocity4 = playgroundParticles.playgroundCache.velocity;
							velocity4[p].x = velocity4[p].x + (float)turbulenceSimplex.noise((double)((playgroundParticles.playgroundCache.position[p].x + num2) * turbulenceScale), (double)((playgroundParticles.playgroundCache.position[p].y + num3) * turbulenceScale), (double)((playgroundParticles.playgroundCache.position[p].z + num4) * turbulenceScale)) * turbulenceStrength * t * num;
						}
						if (!playgroundParticles.axisConstraints.y)
						{
							Vector3[] velocity5 = playgroundParticles.playgroundCache.velocity;
							velocity5[p].y = velocity5[p].y + (float)turbulenceSimplex.noise((double)((playgroundParticles.playgroundCache.position[p].y + num3) * turbulenceScale), (double)((playgroundParticles.playgroundCache.position[p].x + num2) * turbulenceScale), (double)((playgroundParticles.playgroundCache.position[p].z + num4) * turbulenceScale)) * turbulenceStrength * t * num;
						}
						if (!playgroundParticles.axisConstraints.z)
						{
							Vector3[] velocity6 = playgroundParticles.playgroundCache.velocity;
							velocity6[p].z = velocity6[p].z + (float)turbulenceSimplex.noise((double)((playgroundParticles.playgroundCache.position[p].z + num4) * turbulenceScale), (double)((playgroundParticles.playgroundCache.position[p].x + num2) * turbulenceScale), (double)((playgroundParticles.playgroundCache.position[p].y + num3) * turbulenceScale)) * turbulenceStrength * t * num;
						}
					}
				}
				else if (playgroundParticles.turbulenceStrength > 0f)
				{
					if (playgroundParticles.turbulenceApplyLifetimeStrength)
					{
						num = playgroundParticles.turbulenceLifetimeStrength.Evaluate(Mathf.Clamp01(playgroundParticles.playgroundCache.life[p] / (playgroundParticles.playgroundCache.death[p] - playgroundParticles.playgroundCache.birth[p] - playgroundParticles.playgroundCache.lifetimeSubtraction[p])));
					}
					if (num > 0f)
					{
						if (!playgroundParticles.axisConstraints.x)
						{
							Vector3[] velocity7 = playgroundParticles.playgroundCache.velocity;
							velocity7[p].x = velocity7[p].x + (Mathf.PerlinNoise(playgroundParticles.localTime * turbulenceTimeScale, playgroundParticles.playgroundCache.position[p].z * turbulenceScale) - 0.5f) * turbulenceStrength * t * num;
						}
						if (!playgroundParticles.axisConstraints.y)
						{
							Vector3[] velocity8 = playgroundParticles.playgroundCache.velocity;
							velocity8[p].y = velocity8[p].y + (Mathf.PerlinNoise(playgroundParticles.localTime * turbulenceTimeScale, playgroundParticles.playgroundCache.position[p].x * turbulenceScale) - 0.5f) * turbulenceStrength * t * num;
						}
						if (!playgroundParticles.axisConstraints.z)
						{
							Vector3[] velocity9 = playgroundParticles.playgroundCache.velocity;
							velocity9[p].z = velocity9[p].z + (Mathf.PerlinNoise(playgroundParticles.localTime * turbulenceTimeScale, playgroundParticles.playgroundCache.position[p].y * turbulenceScale) - 0.5f) * turbulenceStrength * t * num;
						}
					}
				}
			}
		}

		// Token: 0x06000944 RID: 2372 RVA: 0x0003F390 File Offset: 0x0003D590
		public virtual void CalculateCollisions()
		{
			PlaygroundParticlesC.Collisions(this.thisInstance);
		}

		// Token: 0x06000945 RID: 2373 RVA: 0x0003F3A0 File Offset: 0x0003D5A0
		public static void Collisions(PlaygroundParticlesC playgroundParticles)
		{
			if (!playgroundParticles.calculate || playgroundParticles.inPlayback)
			{
				return;
			}
			if (!playgroundParticles.onlySourcePositioning && !playgroundParticles.onlyLifetimePositioning && playgroundParticles.collisionRadius > 0f && playgroundParticles.hasEmitted)
			{
				Ray ray = default(Ray);
				bool flag = playgroundParticles.collisionType == COLLISIONTYPEC.Physics3D;
				bool flag2 = playgroundParticles.collisionExclusion != null && playgroundParticles.collisionExclusion.Count > 0;
				bool flag3 = playgroundParticles.bounceRandomMin != Vector3.zero || playgroundParticles.bounceRandomMax != Vector3.zero;
				bool flag4 = playgroundParticles.events.Count > 0;
				if ((playgroundParticles.stickyCollisions || playgroundParticles.forceCollisionCaching) && playgroundParticles.collisionCache == null)
				{
					playgroundParticles.collisionCache = new CollisionCache(playgroundParticles.particleCount);
				}
				if (playgroundParticles.collision && playgroundParticles.colliders.Count > 0)
				{
					for (int i = 0; i < playgroundParticles.colliders.Count; i++)
					{
						playgroundParticles.colliders[i].UpdatePlane();
					}
				}
				if (playgroundParticles.playgroundCache.noForce.Length != playgroundParticles.particleCount)
				{
					playgroundParticles.playgroundCache.noForce = new bool[playgroundParticles.particleCount];
				}
				if (playgroundParticles.playgroundCache.lifetimeSubtraction.Length != playgroundParticles.particleCount)
				{
					playgroundParticles.playgroundCache.lifetimeSubtraction = new float[playgroundParticles.particleCount];
				}
				if (playgroundParticles.playgroundCache.lifetimeLoss == null || playgroundParticles.playgroundCache.lifetimeLoss.Length != playgroundParticles.particleCount)
				{
					playgroundParticles.playgroundCache.lifetimeLoss = new float[playgroundParticles.particleCount];
				}
				for (int j = 0; j < playgroundParticles.particleCount; j++)
				{
					if (playgroundParticles.playgroundCache.life[j] != 0f && playgroundParticles.playgroundCache.life[j] < playgroundParticles.playgroundCache.death[j] - playgroundParticles.playgroundCache.birth[j] - playgroundParticles.playgroundCache.lifetimeSubtraction[j] && !playgroundParticles.playgroundCache.noForce[j] && (!playgroundParticles.maskedParticlesBypassCollision || !playgroundParticles.playgroundCache.isMasked[j]))
					{
						if (playgroundParticles.stickyCollisions && playgroundParticles.collisionCache.hasCollided[j])
						{
							playgroundParticles.collisionCache.UpdateStickyPosition(j);
							playgroundParticles.playgroundCache.position[j] = playgroundParticles.collisionCache.stickyPosition[j];
						}
						else
						{
							for (int k = 0; k < playgroundParticles.colliders.Count; k++)
							{
								if (playgroundParticles.colliders[k].enabled && playgroundParticles.colliders[k].transform && !playgroundParticles.colliders[k].plane.GetSide(playgroundParticles.playgroundCache.position[j]))
								{
									ray.origin = playgroundParticles.playgroundCache.position[j];
									ray.direction = playgroundParticles.colliders[k].plane.normal;
									float distance;
									if (playgroundParticles.colliders[k].plane.Raycast(ray, out distance))
									{
										playgroundParticles.playgroundCache.position[j] = ray.GetPoint(distance);
									}
									Vector3 preEventVelocity = playgroundParticles.playgroundCache.velocity[j];
									if (!playgroundParticles.stickyCollisions)
									{
										if (playgroundParticles.forceCollisionCaching)
										{
											playgroundParticles.collisionCache.Set(j, playgroundParticles.playgroundCache.position[j], playgroundParticles.colliders[k].plane.normal, playgroundParticles.colliders[k].transform);
										}
									}
									else
									{
										playgroundParticles.collisionCache.SetSticky(j, playgroundParticles.playgroundCache.position[j], playgroundParticles.colliders[k].plane.normal, playgroundParticles.stickyCollisionsSurfaceOffset, playgroundParticles.colliders[k].transform);
									}
									playgroundParticles.playgroundCache.velocity[j] = Vector3.Reflect(playgroundParticles.playgroundCache.velocity[j], (!flag3) ? playgroundParticles.colliders[k].plane.normal : (playgroundParticles.colliders[k].plane.normal + PlaygroundParticlesC.RandomVector3(playgroundParticles.internalRandom01, playgroundParticles.bounceRandomMin, playgroundParticles.bounceRandomMax))) * playgroundParticles.bounciness;
									if (playgroundParticles.lifetimeLoss > 0f)
									{
										playgroundParticles.playgroundCache.lifetimeLoss[j] = playgroundParticles.lifetime * playgroundParticles.lifetimeLoss;
										playgroundParticles.playgroundCache.changedByPropertyDeath[j] = true;
									}
									if (flag4)
									{
										playgroundParticles.SendEvent(EVENTTYPEC.Collision, j, preEventVelocity, playgroundParticles.colliders[k].transform);
									}
								}
							}
							if (playgroundParticles.playgroundCache.velocity[j].magnitude > PlaygroundC.collisionSleepVelocity)
							{
								if (flag)
								{
									RaycastHit raycastHit;
									if (Physics.Raycast(playgroundParticles.playgroundCache.collisionParticlePosition[j], playgroundParticles.playgroundCache.position[j] - playgroundParticles.playgroundCache.collisionParticlePosition[j], out raycastHit, (!playgroundParticles.collisionPrecision) ? ((Vector3.SqrMagnitude(playgroundParticles.playgroundCache.position[j] - playgroundParticles.playgroundCache.collisionParticlePosition[j]) + playgroundParticles.collisionRadius) * 2f) : ((Vector3.Distance(playgroundParticles.playgroundCache.position[j], playgroundParticles.playgroundCache.collisionParticlePosition[j]) + playgroundParticles.collisionRadius) * 2f), playgroundParticles.collisionMask))
									{
										if (!flag2 || !playgroundParticles.collisionExclusion.Contains(raycastHit.transform))
										{
											playgroundParticles.playgroundCache.position[j] = playgroundParticles.playgroundCache.collisionParticlePosition[j];
											if (!playgroundParticles.stickyCollisions)
											{
												if (playgroundParticles.forceCollisionCaching)
												{
													playgroundParticles.collisionCache.Set(j, raycastHit.point, raycastHit.normal, raycastHit.transform);
												}
											}
											else if ((playgroundParticles.stickyCollisionsMask.value & 1 << raycastHit.transform.gameObject.layer) != 0)
											{
												playgroundParticles.collisionCache.SetSticky(j, raycastHit.point, raycastHit.normal, playgroundParticles.stickyCollisionsSurfaceOffset, raycastHit.transform);
											}
											Vector3 vector = playgroundParticles.playgroundCache.velocity[j];
											playgroundParticles.playgroundCache.velocity[j] = Vector3.Reflect(playgroundParticles.playgroundCache.velocity[j], (!flag3) ? raycastHit.normal : (raycastHit.normal + PlaygroundParticlesC.RandomVector3(playgroundParticles.internalRandom01, playgroundParticles.bounceRandomMin, playgroundParticles.bounceRandomMax))) * playgroundParticles.bounciness;
											if (playgroundParticles.lifetimeLoss > 0f)
											{
												playgroundParticles.playgroundCache.lifetimeLoss[j] = playgroundParticles.lifetime * playgroundParticles.lifetimeLoss;
												playgroundParticles.playgroundCache.changedByPropertyDeath[j] = true;
											}
											if (playgroundParticles.affectRigidbodies && raycastHit.rigidbody)
											{
												raycastHit.rigidbody.AddForceAtPosition(((!playgroundParticles.inverseRigidbodyCollision) ? vector : (-vector)) * playgroundParticles.mass, playgroundParticles.playgroundCache.position[j]);
											}
											if (flag4)
											{
												playgroundParticles.SendEvent(EVENTTYPEC.Collision, j, vector, raycastHit.transform, raycastHit.collider);
											}
											if (playgroundParticles.hasEventManipulatorLocal)
											{
												for (int l = 0; l < playgroundParticles.manipulators.Count; l++)
												{
													if (playgroundParticles.manipulators[l].trackParticles && playgroundParticles.manipulators[l].sendEventCollision && playgroundParticles.manipulators[l].Contains(playgroundParticles.playgroundCache.position[j], playgroundParticles.manipulators[l].transform.position))
													{
														playgroundParticles.UpdateEventParticle(playgroundParticles.manipulators[l].manipulatorEventParticle, j);
														playgroundParticles.manipulators[l].manipulatorEventParticle.collisionCollider = raycastHit.collider;
														playgroundParticles.manipulators[l].manipulatorEventParticle.collisionParticlePosition = raycastHit.point;
														playgroundParticles.manipulators[l].manipulatorEventParticle.collisionTransform = raycastHit.transform;
														playgroundParticles.manipulators[l].SendParticleEventCollision();
													}
												}
											}
											if (playgroundParticles.hasEventManipulatorGlobal)
											{
												for (int m = 0; m < PlaygroundC.reference.manipulators.Count; m++)
												{
													if (PlaygroundC.reference.manipulators[m].trackParticles && PlaygroundC.reference.manipulators[m].sendEventCollision && PlaygroundC.reference.manipulators[m].Contains(playgroundParticles.playgroundCache.position[j], PlaygroundC.reference.manipulators[m].transform.position))
													{
														playgroundParticles.UpdateEventParticle(PlaygroundC.reference.manipulators[m].manipulatorEventParticle, j);
														PlaygroundC.reference.manipulators[m].manipulatorEventParticle.collisionCollider = raycastHit.collider;
														PlaygroundC.reference.manipulators[m].manipulatorEventParticle.collisionParticlePosition = raycastHit.point;
														PlaygroundC.reference.manipulators[m].manipulatorEventParticle.collisionTransform = raycastHit.transform;
														PlaygroundC.reference.manipulators[m].SendParticleEventCollision();
													}
												}
											}
										}
									}
								}
								else
								{
									RaycastHit2D raycastHit2D = Physics2D.Raycast(playgroundParticles.playgroundCache.collisionParticlePosition[j], playgroundParticles.playgroundCache.position[j] - playgroundParticles.playgroundCache.collisionParticlePosition[j], (!playgroundParticles.collisionPrecision) ? ((Vector3.SqrMagnitude(playgroundParticles.playgroundCache.position[j] - playgroundParticles.playgroundCache.collisionParticlePosition[j]) + playgroundParticles.collisionRadius) * 2f) : ((Vector3.Distance(playgroundParticles.playgroundCache.position[j], playgroundParticles.playgroundCache.collisionParticlePosition[j]) + playgroundParticles.collisionRadius) * 2f), playgroundParticles.collisionMask, playgroundParticles.minCollisionDepth, playgroundParticles.maxCollisionDepth);
									if (raycastHit2D.collider != null)
									{
										if (!flag2 || !playgroundParticles.collisionExclusion.Contains(raycastHit2D.transform))
										{
											playgroundParticles.playgroundCache.position[j] = playgroundParticles.playgroundCache.collisionParticlePosition[j];
											if (!playgroundParticles.stickyCollisions)
											{
												if (playgroundParticles.forceCollisionCaching)
												{
													playgroundParticles.collisionCache.Set(j, raycastHit2D.point, raycastHit2D.normal, raycastHit2D.transform);
												}
											}
											else if ((playgroundParticles.stickyCollisionsMask.value & 1 << raycastHit2D.transform.gameObject.layer) != 0)
											{
												playgroundParticles.collisionCache.SetSticky(j, raycastHit2D.point, raycastHit2D.normal, playgroundParticles.stickyCollisionsSurfaceOffset, raycastHit2D.transform);
											}
											Vector3 vector2 = playgroundParticles.playgroundCache.velocity[j];
                                            playgroundParticles.playgroundCache.velocity[j] = Vector3.zero;// Vector3.Reflect(playgroundParticles.playgroundCache.velocity[j], (!flag3) ? raycastHit2D.normal : (raycastHit2D.normal + PlaygroundParticlesC.RandomVector3(playgroundParticles.internalRandom01, playgroundParticles.bounceRandomMin, playgroundParticles.bounceRandomMax))) * playgroundParticles.bounciness;
											if (playgroundParticles.lifetimeLoss > 0f)
											{
												playgroundParticles.playgroundCache.lifetimeLoss[j] = playgroundParticles.lifetime * playgroundParticles.lifetimeLoss;
												playgroundParticles.playgroundCache.changedByPropertyDeath[j] = true;
											}
											if (playgroundParticles.affectRigidbodies && raycastHit2D.rigidbody)
											{
												raycastHit2D.rigidbody.AddForceAtPosition(((!playgroundParticles.inverseRigidbodyCollision) ? vector2 : (-vector2)) * playgroundParticles.mass, playgroundParticles.playgroundCache.position[j]);
											}
											if (flag4)
											{
												playgroundParticles.SendEvent(EVENTTYPEC.Collision, j, vector2, raycastHit2D.transform, raycastHit2D.collider);
											}
											if (playgroundParticles.hasEventManipulatorLocal)
											{
												for (int n = 0; n < playgroundParticles.manipulators.Count; n++)
												{
													if (playgroundParticles.manipulators[n].trackParticles && playgroundParticles.manipulators[n].sendEventCollision && playgroundParticles.manipulators[n].Contains(playgroundParticles.playgroundCache.position[j], playgroundParticles.manipulators[n].transform.position))
													{
														playgroundParticles.UpdateEventParticle(playgroundParticles.manipulators[n].manipulatorEventParticle, j);
														playgroundParticles.manipulators[n].manipulatorEventParticle.collisionCollider2D = raycastHit2D.collider;
														playgroundParticles.manipulators[n].manipulatorEventParticle.collisionParticlePosition = raycastHit2D.point;
														playgroundParticles.manipulators[n].manipulatorEventParticle.collisionTransform = raycastHit2D.transform;
														playgroundParticles.manipulators[n].SendParticleEventCollision();
													}
												}
											}
											if (playgroundParticles.hasEventManipulatorGlobal)
											{
												for (int num = 0; num < PlaygroundC.reference.manipulators.Count; num++)
												{
													if (PlaygroundC.reference.manipulators[num].trackParticles && PlaygroundC.reference.manipulators[num].sendEventCollision && PlaygroundC.reference.manipulators[num].Contains(playgroundParticles.playgroundCache.position[j], PlaygroundC.reference.manipulators[num].transform.position))
													{
														playgroundParticles.UpdateEventParticle(PlaygroundC.reference.manipulators[num].manipulatorEventParticle, j);
														playgroundParticles.manipulators[num].manipulatorEventParticle.collisionCollider2D = raycastHit2D.collider;
														playgroundParticles.manipulators[num].manipulatorEventParticle.collisionParticlePosition = raycastHit2D.point;
														playgroundParticles.manipulators[num].manipulatorEventParticle.collisionTransform = raycastHit2D.transform;
														PlaygroundC.reference.manipulators[num].SendParticleEventCollision();
													}
												}
											}
										}
									}
								}
							}
							else
							{
								playgroundParticles.playgroundCache.velocity[j] = Vector3.zero;
							}
						}
					}
				}
			}
		}

		// Token: 0x06000946 RID: 2374 RVA: 0x000404F8 File Offset: 0x0003E6F8
		public static Vector3 GetOverflow2(Vector3 overflow, int currentVal, int maxVal)
		{
			float num = (float)(currentVal / maxVal);
			return new Vector3(overflow.x * num, overflow.y * num, overflow.z * num);
		}

		// Token: 0x06000947 RID: 2375 RVA: 0x0004052C File Offset: 0x0003E72C
		public static Vector3 GetOverflow2(Vector3 overflow, Vector3 direction, int currentVal, int maxVal)
		{
			float num = (float)(currentVal / maxVal);
			return new Vector3(direction.x * overflow.x * num, direction.y * overflow.y * num, direction.z * overflow.z * num);
		}

		// Token: 0x06000948 RID: 2376 RVA: 0x00040578 File Offset: 0x0003E778
		public static Vector3 Vector3Scale(Vector3 v1, Vector3 v2)
		{
			return new Vector3(v1.x * v2.x, v1.y * v2.y, v1.z * v2.z);
		}

		// Token: 0x06000949 RID: 2377 RVA: 0x000405AC File Offset: 0x0003E7AC
		public static void CalculateManipulator(PlaygroundParticlesC playgroundParticles, ManipulatorObjectC thisManipulator, int p, float t, float life, Vector3 particlePosition, Vector3 manipulatorPosition, bool localSpace)
		{
			if (thisManipulator.enabled && thisManipulator.transform.available && thisManipulator.strength != 0f && thisManipulator.LifetimeFilter(life, playgroundParticles.lifetime) && thisManipulator.ParticleFilter(p, playgroundParticles.particleCount))
			{
				bool flag = thisManipulator.Contains((!localSpace) ? particlePosition : (playgroundParticles.particleSystemRotation * particlePosition), (!localSpace) ? manipulatorPosition : (playgroundParticles.particleSystemRotation * manipulatorPosition));
				if (flag && (playgroundParticles.playgroundCache.excludeFromManipulatorId[p] == thisManipulator.manipulatorId || (thisManipulator.nonAffectedParticles.Count > 0 && thisManipulator.ContainsNonAffectedParticle(playgroundParticles.particleSystemId, p))))
				{
					return;
				}
				if (thisManipulator.trackParticles)
				{
					if (flag)
					{
						if ((thisManipulator.trackingMethod == TrackingMethod.ManipulatorId && !thisManipulator.IsSameId(playgroundParticles.playgroundCache.manipulatorId[p])) || (thisManipulator.trackingMethod == TrackingMethod.ParticleId && !thisManipulator.ContainsParticle(playgroundParticles.particleSystemId, p)))
						{
							playgroundParticles.playgroundCache.manipulatorId[p] = thisManipulator.manipulatorId;
							thisManipulator.AddParticle(playgroundParticles.particleSystemId, p);
							if (thisManipulator.sendEventEnter)
							{
								playgroundParticles.UpdateEventParticle(thisManipulator.manipulatorEventParticle, p);
								thisManipulator.SendParticleEventEnter();
							}
						}
					}
					else if ((thisManipulator.trackingMethod == TrackingMethod.ManipulatorId && thisManipulator.IsSameId(playgroundParticles.playgroundCache.manipulatorId[p])) || (thisManipulator.trackingMethod == TrackingMethod.ParticleId && thisManipulator.ContainsParticle(playgroundParticles.particleSystemId, p)))
					{
						playgroundParticles.playgroundCache.manipulatorId[p] = 0;
						thisManipulator.RemoveParticle(playgroundParticles.particleSystemId, p);
						if (thisManipulator.sendEventExit)
						{
							playgroundParticles.UpdateEventParticle(thisManipulator.manipulatorEventParticle, p);
							thisManipulator.SendParticleEventExit();
						}
					}
				}
				float num = (!thisManipulator.applyParticleLifetimeStrength) ? thisManipulator.strength : (thisManipulator.strength * thisManipulator.particleLifetimeStrength.Evaluate((life - playgroundParticles.playgroundCache.lifetimeSubtraction[p]) / playgroundParticles.lifetime));
				bool flag2 = thisManipulator.axisConstraints.HasConstraints();
				Vector3 vector = playgroundParticles.playgroundCache.velocity[p];
				if (!playgroundParticles.onlySourcePositioning && !playgroundParticles.playgroundCache.noForce[p])
				{
					if (thisManipulator.type == MANIPULATORTYPEC.Attractor)
					{
						if (flag)
						{
							float num2 = (thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.Distance(manipulatorPosition, playgroundParticles.playgroundCache.position[p]) / thisManipulator.strengthDistanceEffect);
							playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], (manipulatorPosition - particlePosition) * (num / num2), t * (num / num2) / thisManipulator.strengthSmoothing);
						}
					}
					else if (thisManipulator.type == MANIPULATORTYPEC.AttractorGravitational)
					{
						if (flag)
						{
							float num2 = (thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.Distance(manipulatorPosition, playgroundParticles.playgroundCache.position[p]) / thisManipulator.strengthDistanceEffect);
							playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], (manipulatorPosition - particlePosition) * num / num2, t / thisManipulator.strengthSmoothing);
						}
					}
					else if (thisManipulator.type == MANIPULATORTYPEC.Repellent)
					{
						if (flag)
						{
							float num2 = (thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.Distance(manipulatorPosition, playgroundParticles.playgroundCache.position[p]) / thisManipulator.strengthDistanceEffect);
							playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], (particlePosition - manipulatorPosition) * (num / num2), t * (num / num2) / thisManipulator.strengthSmoothing);
						}
					}
					else if (thisManipulator.type == MANIPULATORTYPEC.Vortex && flag)
					{
						float num2 = (thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.Distance(manipulatorPosition, playgroundParticles.playgroundCache.position[p]) / thisManipulator.strengthDistanceEffect);
						playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], (manipulatorPosition - particlePosition) * num / num2 - Vector3.Cross(thisManipulator.transform.up, manipulatorPosition - particlePosition) * num / num2, t * num / num2 / thisManipulator.strengthSmoothing);
					}
				}
				if (thisManipulator.type == MANIPULATORTYPEC.Property)
				{
					float num2 = (thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect);
					PlaygroundParticlesC.PropertyManipulator(playgroundParticles, thisManipulator, thisManipulator.property, num, p, t, particlePosition, manipulatorPosition, num2, localSpace, flag);
				}
				else if (thisManipulator.type == MANIPULATORTYPEC.Combined)
				{
					float num2 = (thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect);
					for (int i = 0; i < thisManipulator.properties.Count; i++)
					{
						PlaygroundParticlesC.PropertyManipulator(playgroundParticles, thisManipulator, thisManipulator.properties[i], num, p, t, particlePosition, manipulatorPosition, num2, localSpace, flag);
					}
				}
				if (flag2)
				{
					playgroundParticles.playgroundCache.velocity[p] = new Vector3((!thisManipulator.axisConstraints.x) ? playgroundParticles.playgroundCache.velocity[p].x : vector.x, (!thisManipulator.axisConstraints.y) ? playgroundParticles.playgroundCache.velocity[p].y : vector.y, (!thisManipulator.axisConstraints.z) ? playgroundParticles.playgroundCache.velocity[p].z : vector.z);
					playgroundParticles.playgroundCache.position[p] = new Vector3((!thisManipulator.axisConstraints.x) ? playgroundParticles.playgroundCache.position[p].x : particlePosition.x, (!thisManipulator.axisConstraints.y) ? playgroundParticles.playgroundCache.position[p].y : particlePosition.y, (!thisManipulator.axisConstraints.z) ? playgroundParticles.playgroundCache.position[p].z : particlePosition.z);
				}
			}
		}

		// Token: 0x0600094A RID: 2378 RVA: 0x00040D18 File Offset: 0x0003EF18
		public static void PropertyManipulator(PlaygroundParticlesC playgroundParticles, ManipulatorObjectC thisManipulator, ManipulatorPropertyC thisManipulatorProperty, float manipulatorStrength, int p, float t, Vector3 particlePosition, Vector3 manipulatorPosition, float manipulatorDistance, bool localSpace, bool contains)
		{
			if (contains)
			{
				switch (thisManipulatorProperty.type)
				{
				case MANIPULATORPROPERTYTYPEC.Color:
					if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.None)
					{
						if (thisManipulatorProperty.keepColorAlphas)
						{
							Color color = thisManipulatorProperty.color;
							color.a = Mathf.Clamp(playgroundParticles.lifetimeColor.Evaluate(playgroundParticles.playgroundCache.life[p] / playgroundParticles.lifetime).a, 0f, color.a);
							playgroundParticles.SetParticleColorInternal(p, color);
						}
						else
						{
							playgroundParticles.SetParticleColorInternal(p, thisManipulatorProperty.color);
						}
					}
					else
					{
						if (thisManipulatorProperty.keepColorAlphas)
						{
							manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect));
							Color color = thisManipulatorProperty.color;
							color.a = Mathf.Clamp(playgroundParticles.lifetimeColor.Evaluate(playgroundParticles.playgroundCache.life[p] / playgroundParticles.lifetime).a, 0f, color.a);
							playgroundParticles.SetParticleColorInternal(p, Color.Lerp(playgroundParticles.particleCache[p].startColor, color, t * thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance / thisManipulator.strengthSmoothing));
						}
						else
						{
							playgroundParticles.SetParticleColorInternal(p, Color.Lerp(playgroundParticles.particleCache[p].startColor, thisManipulatorProperty.color, t * thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance / thisManipulator.strengthSmoothing));
						}
						playgroundParticles.playgroundCache.changedByPropertyColorLerp[p] = true;
					}
					playgroundParticles.playgroundCache.changedByPropertyColor[p] = true;
					if (thisManipulatorProperty.keepColorAlphas)
					{
						playgroundParticles.playgroundCache.changedByPropertyColorKeepAlpha[p] = true;
					}
					if (playgroundParticles.playgroundCache.propertyColorId[p] != thisManipulator.manipulatorId)
					{
						playgroundParticles.playgroundCache.propertyColorId[p] = thisManipulator.manipulatorId;
					}
					break;
				case MANIPULATORPROPERTYTYPEC.Velocity:
					if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.None)
					{
						playgroundParticles.playgroundCache.velocity[p] = ((!thisManipulatorProperty.useLocalRotation) ? thisManipulatorProperty.velocity : thisManipulatorProperty.localVelocity);
					}
					else
					{
						manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect));
						playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], (!thisManipulatorProperty.useLocalRotation) ? thisManipulatorProperty.velocity : thisManipulatorProperty.localVelocity, t * thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance / thisManipulator.strengthSmoothing);
					}
					break;
				case MANIPULATORPROPERTYTYPEC.AdditiveVelocity:
					manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect));
					playgroundParticles.playgroundCache.velocity[p] += ((!thisManipulatorProperty.useLocalRotation) ? (thisManipulatorProperty.velocity * (t * thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance / thisManipulator.strengthSmoothing)) : (thisManipulatorProperty.localVelocity * (t * thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance / thisManipulator.strengthSmoothing)));
					break;
				case MANIPULATORPROPERTYTYPEC.Size:
					if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.None)
					{
						manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 0f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect));
						if (manipulatorDistance == 0f)
						{
							playgroundParticles.playgroundCache.size[p] = thisManipulatorProperty.size;
						}
						else
						{
							playgroundParticles.playgroundCache.size[p] = thisManipulatorProperty.size + thisManipulatorProperty.size / (1f + manipulatorDistance / thisManipulator.strengthSmoothing) * (thisManipulator.strength * thisManipulatorProperty.strength);
						}
					}
					else if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.Lerp)
					{
						manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect));
						playgroundParticles.playgroundCache.size[p] = Mathf.Lerp(playgroundParticles.playgroundCache.size[p], thisManipulatorProperty.size, t * thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance / thisManipulator.strengthSmoothing);
					}
					else if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.Linear)
					{
						manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect));
						playgroundParticles.playgroundCache.size[p] = Mathf.MoveTowards(playgroundParticles.playgroundCache.size[p], thisManipulatorProperty.size, t * thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance / thisManipulator.strengthSmoothing);
					}
					playgroundParticles.playgroundCache.changedByPropertySize[p] = true;
					break;
				case MANIPULATORPROPERTYTYPEC.Target:
					if (thisManipulatorProperty.targets.Count > 0 && thisManipulatorProperty.targets[thisManipulatorProperty.targetPointer].available)
					{
						if (playgroundParticles.playgroundCache.propertyId[p] != thisManipulator.manipulatorId)
						{
							playgroundParticles.playgroundCache.propertyTarget[p] = thisManipulatorProperty.targetPointer;
							thisManipulatorProperty.targetPointer++;
							thisManipulatorProperty.targetPointer %= thisManipulatorProperty.targets.Count;
							playgroundParticles.playgroundCache.propertyId[p] = thisManipulator.manipulatorId;
						}
						if (playgroundParticles.playgroundCache.propertyId[p] == thisManipulator.manipulatorId && thisManipulatorProperty.targets[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.targets.Count].available)
						{
							if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.None)
							{
								playgroundParticles.playgroundCache.position[p] = ((!localSpace) ? thisManipulatorProperty.targets[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.targets.Count].position : thisManipulatorProperty.targets[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.targets.Count].localPosition);
							}
							else if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.Lerp)
							{
								manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect));
								playgroundParticles.playgroundCache.position[p] = ((!localSpace) ? Vector3.Lerp(particlePosition, thisManipulatorProperty.targets[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.targets.Count].position, t * thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance / thisManipulator.strengthSmoothing) : Vector3.Lerp(particlePosition, thisManipulatorProperty.targets[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.targets.Count].localPosition, t * thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance / thisManipulator.strengthSmoothing));
								if (thisManipulatorProperty.zeroVelocityStrength > 0f)
								{
									playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], Vector3.zero, t * thisManipulatorProperty.zeroVelocityStrength);
								}
							}
							else if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.Linear)
							{
								manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect));
								playgroundParticles.playgroundCache.position[p] = ((!localSpace) ? Vector3.MoveTowards(particlePosition, thisManipulatorProperty.targets[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.targets.Count].position, t * thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance / thisManipulator.strengthSmoothing) : Vector3.MoveTowards(particlePosition, thisManipulatorProperty.targets[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.targets.Count].localPosition, t * thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance / thisManipulator.strengthSmoothing));
								if (thisManipulatorProperty.zeroVelocityStrength > 0f)
								{
									playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], Vector3.zero, t * thisManipulatorProperty.zeroVelocityStrength);
								}
							}
							playgroundParticles.playgroundCache.changedByPropertyTarget[p] = true;
						}
					}
					break;
				case MANIPULATORPROPERTYTYPEC.Death:
					if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.None)
					{
						playgroundParticles.playgroundCache.life[p] = playgroundParticles.lifetime;
					}
					else
					{
						manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect));
						playgroundParticles.playgroundCache.birth[p] -= t * thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance / thisManipulator.strengthSmoothing;
					}
					playgroundParticles.playgroundCache.changedByPropertyDeath[p] = true;
					break;
				case MANIPULATORPROPERTYTYPEC.Attractor:
					if (!playgroundParticles.onlySourcePositioning)
					{
						manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.Distance(manipulatorPosition, playgroundParticles.playgroundCache.position[p]) / thisManipulator.strengthDistanceEffect));
						playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], (manipulatorPosition - particlePosition) * (thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance), t * (thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance) / thisManipulator.strengthSmoothing);
					}
					break;
				case MANIPULATORPROPERTYTYPEC.Gravitational:
					if (!playgroundParticles.onlySourcePositioning)
					{
						manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.Distance(manipulatorPosition, playgroundParticles.playgroundCache.position[p]) / thisManipulator.strengthDistanceEffect));
						playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], (manipulatorPosition - particlePosition) * (thisManipulatorProperty.strength * manipulatorStrength) / manipulatorDistance, t / thisManipulator.strengthSmoothing);
					}
					break;
				case MANIPULATORPROPERTYTYPEC.Repellent:
					if (!playgroundParticles.onlySourcePositioning)
					{
						manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.Distance(manipulatorPosition, playgroundParticles.playgroundCache.position[p]) / thisManipulator.strengthDistanceEffect));
						playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], (particlePosition - manipulatorPosition) * (thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance), t * (thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance) / thisManipulator.strengthSmoothing);
					}
					break;
				case MANIPULATORPROPERTYTYPEC.LifetimeColor:
					if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.None)
					{
						playgroundParticles.SetParticleColorInternal(p, thisManipulatorProperty.lifetimeColor.Evaluate((playgroundParticles.lifetime <= 0f) ? 0f : (playgroundParticles.playgroundCache.life[p] / playgroundParticles.lifetime)));
					}
					else
					{
						playgroundParticles.SetParticleColorInternal(p, Color.Lerp(playgroundParticles.particleCache[p].startColor, thisManipulatorProperty.lifetimeColor.Evaluate((playgroundParticles.lifetime <= 0f) ? 0f : (playgroundParticles.playgroundCache.life[p] / playgroundParticles.lifetime)), t * thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance / thisManipulator.strengthSmoothing));
						playgroundParticles.playgroundCache.changedByPropertyColorLerp[p] = true;
					}
					playgroundParticles.playgroundCache.changedByPropertyColor[p] = true;
					if (playgroundParticles.playgroundCache.propertyColorId[p] != thisManipulator.manipulatorId)
					{
						playgroundParticles.playgroundCache.propertyColorId[p] = thisManipulator.manipulatorId;
					}
					break;
				case MANIPULATORPROPERTYTYPEC.Vortex:
					if (!playgroundParticles.onlySourcePositioning)
					{
						manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.Distance(manipulatorPosition, playgroundParticles.playgroundCache.position[p]) / thisManipulator.strengthDistanceEffect));
						playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], (manipulatorPosition - particlePosition) * (manipulatorStrength * thisManipulatorProperty.strength) / manipulatorDistance - Vector3.Cross(thisManipulator.transform.up, manipulatorPosition - particlePosition) * (manipulatorStrength * thisManipulatorProperty.strength) / manipulatorDistance, t * (manipulatorStrength * thisManipulatorProperty.strength) / manipulatorDistance / thisManipulator.strengthSmoothing);
					}
					break;
				case MANIPULATORPROPERTYTYPEC.MeshTarget:
					if (!playgroundParticles.onlySourcePositioning && thisManipulatorProperty.meshTarget.initialized)
					{
						if (playgroundParticles.playgroundCache.propertyId[p] != thisManipulator.manipulatorId)
						{
							playgroundParticles.playgroundCache.propertyTarget[p] = thisManipulatorProperty.targetSortingList[thisManipulatorProperty.targetPointer];
							thisManipulatorProperty.targetPointer++;
							thisManipulatorProperty.targetPointer %= thisManipulatorProperty.meshTarget.vertexPositions.Length;
							playgroundParticles.playgroundCache.propertyId[p] = thisManipulator.manipulatorId;
						}
						if (playgroundParticles.playgroundCache.propertyId[p] == thisManipulator.manipulatorId)
						{
							if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.None)
							{
								playgroundParticles.playgroundCache.position[p] = thisManipulatorProperty.meshTargetMatrix.MultiplyPoint3x4(thisManipulatorProperty.meshTarget.vertexPositions[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.meshTarget.vertexPositions.Length]);
								playgroundParticles.playgroundCache.velocity[p] = Vector3.zero;
							}
							else if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.Lerp)
							{
								playgroundParticles.playgroundCache.position[p] = Vector3.Lerp(particlePosition, thisManipulatorProperty.meshTargetMatrix.MultiplyPoint3x4(thisManipulatorProperty.meshTarget.vertexPositions[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.meshTarget.vertexPositions.Length]), t * thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance / thisManipulator.strengthSmoothing);
								if (thisManipulatorProperty.zeroVelocityStrength > 0f)
								{
									playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], Vector3.zero, t * thisManipulatorProperty.zeroVelocityStrength);
								}
							}
							else if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.Linear)
							{
								playgroundParticles.playgroundCache.position[p] = Vector3.MoveTowards(particlePosition, thisManipulatorProperty.meshTargetMatrix.MultiplyPoint3x4(thisManipulatorProperty.meshTarget.vertexPositions[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.meshTarget.vertexPositions.Length]), t * thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance / thisManipulator.strengthSmoothing);
								if (thisManipulatorProperty.zeroVelocityStrength > 0f)
								{
									playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], Vector3.zero, t * thisManipulatorProperty.zeroVelocityStrength);
								}
							}
							playgroundParticles.playgroundCache.changedByPropertyTarget[p] = true;
						}
					}
					break;
				case MANIPULATORPROPERTYTYPEC.SkinnedMeshTarget:
					if (!playgroundParticles.onlySourcePositioning && thisManipulatorProperty.skinnedMeshTarget.initialized)
					{
						if (playgroundParticles.playgroundCache.propertyId[p] != thisManipulator.manipulatorId)
						{
							playgroundParticles.playgroundCache.propertyTarget[p] = thisManipulatorProperty.targetSortingList[thisManipulatorProperty.targetPointer];
							thisManipulatorProperty.targetPointer++;
							thisManipulatorProperty.targetPointer %= thisManipulatorProperty.skinnedMeshTarget.vertexPositions.Length;
							playgroundParticles.playgroundCache.propertyId[p] = thisManipulator.manipulatorId;
						}
						if (playgroundParticles.playgroundCache.propertyId[p] == thisManipulator.manipulatorId)
						{
							if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.None)
							{
								playgroundParticles.playgroundCache.position[p] = thisManipulatorProperty.skinnedMeshTarget.vertexPositions[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.skinnedMeshTarget.vertexPositions.Length];
								playgroundParticles.playgroundCache.velocity[p] = Vector3.zero;
							}
							else if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.Lerp)
							{
								manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect));
								playgroundParticles.playgroundCache.position[p] = Vector3.Lerp(particlePosition, thisManipulatorProperty.skinnedMeshTarget.vertexPositions[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.skinnedMeshTarget.vertexPositions.Length], t * (thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance) / thisManipulator.strengthSmoothing);
								if (thisManipulatorProperty.zeroVelocityStrength > 0f)
								{
									playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], Vector3.zero, t * thisManipulatorProperty.zeroVelocityStrength);
								}
							}
							else if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.Linear)
							{
								manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect));
								playgroundParticles.playgroundCache.position[p] = Vector3.MoveTowards(particlePosition, thisManipulatorProperty.skinnedMeshTarget.vertexPositions[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.skinnedMeshTarget.vertexPositions.Length], t * (thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance) / thisManipulator.strengthSmoothing);
								if (thisManipulatorProperty.zeroVelocityStrength > 0f)
								{
									playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], Vector3.zero, t * thisManipulatorProperty.zeroVelocityStrength);
								}
							}
							playgroundParticles.playgroundCache.changedByPropertyTarget[p] = true;
						}
					}
					break;
				case MANIPULATORPROPERTYTYPEC.Turbulence:
					if (!playgroundParticles.onlySourcePositioning && thisManipulatorProperty.turbulenceType != TURBULENCETYPE.None)
					{
						manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.Distance(manipulatorPosition, particlePosition) / thisManipulator.strengthDistanceEffect));
						PlaygroundParticlesC.Turbulence(playgroundParticles, thisManipulatorProperty.turbulenceSimplex, p, t / thisManipulator.strengthSmoothing, thisManipulatorProperty.turbulenceType, thisManipulatorProperty.turbulenceTimeScale, thisManipulatorProperty.turbulenceScale, thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance, thisManipulatorProperty.turbulenceApplyLifetimeStrength, thisManipulatorProperty.turbulenceLifetimeStrength);
					}
					break;
				case MANIPULATORPROPERTYTYPEC.StateTarget:
					if (!playgroundParticles.onlySourcePositioning && thisManipulatorProperty.stateTarget.initialized && !thisManipulatorProperty.stateTarget.IsInitializing())
					{
						if (playgroundParticles.playgroundCache.propertyId[p] != thisManipulator.manipulatorId)
						{
							playgroundParticles.playgroundCache.propertyTarget[p] = thisManipulatorProperty.targetSortingList[thisManipulatorProperty.targetPointer % thisManipulatorProperty.targetSortingList.Length];
							thisManipulatorProperty.targetPointer++;
							thisManipulatorProperty.targetPointer %= thisManipulatorProperty.stateTarget.positionLength;
							playgroundParticles.playgroundCache.propertyId[p] = thisManipulator.manipulatorId;
						}
						if (playgroundParticles.playgroundCache.propertyId[p] == thisManipulator.manipulatorId)
						{
							Vector3 vector = thisManipulatorProperty.stateTarget.stateTransformMx.MultiplyPoint3x4(thisManipulatorProperty.stateTarget.GetPosition(playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.stateTarget.positionLength));
							if (!thisManipulatorProperty.onlyPositionInRange || thisManipulator.shape == MANIPULATORSHAPEC.Infinite || (thisManipulatorProperty.onlyPositionInRange && thisManipulator.Contains(vector, manipulatorPosition)))
							{
								if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.None)
								{
									playgroundParticles.playgroundCache.position[p] = vector;
									playgroundParticles.playgroundCache.velocity[p] = Vector3.zero;
								}
								else if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.Lerp)
								{
									manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect));
									playgroundParticles.playgroundCache.position[p] = Vector3.Lerp(particlePosition, vector, t * (thisManipulatorProperty.strength * thisManipulator.strength / manipulatorDistance) / thisManipulator.strengthSmoothing);
									if (thisManipulatorProperty.zeroVelocityStrength > 0f)
									{
										playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], Vector3.zero, t * thisManipulatorProperty.zeroVelocityStrength);
									}
								}
								else if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.Linear)
								{
									manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect));
									playgroundParticles.playgroundCache.position[p] = Vector3.MoveTowards(particlePosition, vector, t * (thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance) / thisManipulator.strengthSmoothing);
									if (thisManipulatorProperty.zeroVelocityStrength > 0f)
									{
										playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], Vector3.zero, t * thisManipulatorProperty.zeroVelocityStrength);
									}
								}
								playgroundParticles.playgroundCache.changedByPropertyTarget[p] = true;
							}
						}
					}
					break;
				case MANIPULATORPROPERTYTYPEC.SplineTarget:
					if (!playgroundParticles.onlySourcePositioning && thisManipulatorProperty.SplineTargetIsReady())
					{
						if (playgroundParticles.playgroundCache.propertyId[p] != thisManipulator.manipulatorId)
						{
							playgroundParticles.playgroundCache.propertyId[p] = thisManipulator.manipulatorId;
						}
						if (playgroundParticles.playgroundCache.propertyId[p] == thisManipulator.manipulatorId)
						{
							float a;
							if (thisManipulatorProperty.splineTargetMethod == SPLINETARGETMETHOD.SplineTime)
							{
								a = (float)p * 1f / ((float)playgroundParticles.particleCount * 1f) + thisManipulatorProperty.splineTimeOffset;
							}
							else
							{
								a = Mathf.Clamp01(playgroundParticles.playgroundCache.life[p] / (playgroundParticles.playgroundCache.death[p] - playgroundParticles.playgroundCache.birth[p] - playgroundParticles.playgroundCache.lifetimeSubtraction[p]) + thisManipulatorProperty.splineTimeOffset);
							}
							if (Mathf.Approximately(thisManipulatorProperty.splineTimeOffset, 0f) && Mathf.Approximately(a, 1f))
							{
								a = 0.9999f;
							}
							Vector3 point = thisManipulatorProperty.splineTarget.GetPoint(a);
							if (!thisManipulatorProperty.onlyPositionInRange || thisManipulator.shape == MANIPULATORSHAPEC.Infinite || (thisManipulatorProperty.onlyPositionInRange && thisManipulator.Contains(point, manipulatorPosition)))
							{
								if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.None)
								{
									playgroundParticles.playgroundCache.position[p] = point;
									playgroundParticles.playgroundCache.velocity[p] = Vector3.zero;
								}
								else if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.Lerp)
								{
									manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect));
									playgroundParticles.playgroundCache.position[p] = Vector3.Lerp(particlePosition, point, t * (thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance) / thisManipulator.strengthSmoothing);
									if (thisManipulatorProperty.zeroVelocityStrength > 0f)
									{
										playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], Vector3.zero, t * thisManipulatorProperty.zeroVelocityStrength);
									}
								}
								else if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.Linear)
								{
									manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect));
									playgroundParticles.playgroundCache.position[p] = Vector3.MoveTowards(particlePosition, point, t * (thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance) / thisManipulator.strengthSmoothing);
									if (thisManipulatorProperty.zeroVelocityStrength > 0f)
									{
										playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], Vector3.zero, t * thisManipulatorProperty.zeroVelocityStrength);
									}
								}
								playgroundParticles.playgroundCache.changedByPropertyTarget[p] = true;
							}
						}
					}
					break;
				case MANIPULATORPROPERTYTYPEC.Math:
					if (thisManipulatorProperty.mathProperty.type == MATHMANIPULATORTYPE.Sin || thisManipulatorProperty.mathProperty.type == MATHMANIPULATORTYPE.Cos)
					{
						t = playgroundParticles.localTime;
					}
					switch (thisManipulatorProperty.mathProperty.property)
					{
					case MATHMANIPULATORPROPERTY.Size:
						playgroundParticles.playgroundCache.size[p] = thisManipulatorProperty.mathProperty.Evaluate(playgroundParticles.playgroundCache.size[p], t);
						playgroundParticles.playgroundCache.changedByPropertySize[p] = true;
						break;
					case MATHMANIPULATORPROPERTY.Rotation:
						if (!playgroundParticles.rotateTowardsDirection)
						{
							playgroundParticles.playgroundCache.rotation[p] = thisManipulatorProperty.mathProperty.Evaluate(playgroundParticles.playgroundCache.rotation[p], t) % 360f;
						}
						break;
					case MATHMANIPULATORPROPERTY.Velocity:
						playgroundParticles.playgroundCache.velocity[p] = thisManipulatorProperty.mathProperty.Evaluate(playgroundParticles.playgroundCache.velocity[p], t);
						break;
					case MATHMANIPULATORPROPERTY.Position:
						playgroundParticles.playgroundCache.position[p] = thisManipulatorProperty.mathProperty.EvaluatePosition(playgroundParticles.playgroundCache.position[p], t);
						break;
					}
					break;
				}
				playgroundParticles.playgroundCache.changedByProperty[p] = true;
			}
			else
			{
				if (thisManipulatorProperty.onlySizeInRange)
				{
					playgroundParticles.playgroundCache.changedByPropertySize[p] = false;
				}
				if (playgroundParticles.playgroundCache.propertyColorId[p] == thisManipulator.manipulatorId && (thisManipulatorProperty.type == MANIPULATORPROPERTYTYPEC.Color || thisManipulatorProperty.type == MANIPULATORPROPERTYTYPEC.LifetimeColor))
				{
					if (playgroundParticles.playgroundCache.changedByPropertyColorLerp[p] && thisManipulatorProperty.transition != MANIPULATORPROPERTYTRANSITIONC.None && thisManipulatorProperty.onlyColorInRange)
					{
						playgroundParticles.SetParticleColorInternal(p, Color.Lerp(playgroundParticles.particleCache[p].startColor, playgroundParticles.lifetimeColor.Evaluate(playgroundParticles.playgroundCache.life[p] / playgroundParticles.lifetime), t * thisManipulatorProperty.strength * manipulatorStrength));
					}
					if (thisManipulatorProperty.type == MANIPULATORPROPERTYTYPEC.LifetimeColor && !thisManipulatorProperty.onlyColorInRange)
					{
						if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.None)
						{
							playgroundParticles.SetParticleColorInternal(p, thisManipulatorProperty.lifetimeColor.Evaluate((playgroundParticles.lifetime <= 0f) ? 0f : (playgroundParticles.playgroundCache.life[p] / playgroundParticles.lifetime)));
						}
						else
						{
							manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect));
							playgroundParticles.SetParticleColorInternal(p, Color.Lerp(playgroundParticles.particleCache[p].startColor, thisManipulatorProperty.lifetimeColor.Evaluate((playgroundParticles.lifetime <= 0f) ? 0f : (playgroundParticles.playgroundCache.life[p] / playgroundParticles.lifetime)), t * thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance / thisManipulator.strengthSmoothing));
						}
					}
					if (thisManipulatorProperty.onlyColorInRange)
					{
						playgroundParticles.playgroundCache.changedByPropertyColor[p] = false;
					}
				}
				if (!playgroundParticles.onlySourcePositioning && !thisManipulatorProperty.onlyPositionInRange && thisManipulator.shape != MANIPULATORSHAPEC.Infinite && thisManipulatorProperty.transition != MANIPULATORPROPERTYTRANSITIONC.None)
				{
					if (thisManipulatorProperty.type == MANIPULATORPROPERTYTYPEC.Target && thisManipulatorProperty.targets.Count > 0 && thisManipulatorProperty.targets[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.targets.Count] != null && playgroundParticles.playgroundCache.changedByPropertyTarget[p] && thisManipulatorProperty.targets[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.targets.Count].available && playgroundParticles.playgroundCache.propertyId[p] == thisManipulator.transform.GetInstanceID())
					{
						if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.Lerp)
						{
							playgroundParticles.playgroundCache.position[p] = ((!localSpace) ? Vector3.Lerp(particlePosition, thisManipulatorProperty.targets[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.targets.Count].position, t * (thisManipulatorProperty.strength * manipulatorStrength) / thisManipulator.strengthSmoothing) : Vector3.Lerp(particlePosition, thisManipulatorProperty.targets[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.targets.Count].localPosition, t * (thisManipulatorProperty.strength * manipulatorStrength) / thisManipulator.strengthSmoothing));
						}
						else
						{
							playgroundParticles.playgroundCache.position[p] = ((!localSpace) ? Vector3.MoveTowards(particlePosition, thisManipulatorProperty.targets[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.targets.Count].position, t * (thisManipulatorProperty.strength * manipulatorStrength) / thisManipulator.strengthSmoothing) : Vector3.MoveTowards(particlePosition, thisManipulatorProperty.targets[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.targets.Count].localPosition, t * (thisManipulatorProperty.strength * manipulatorStrength) / thisManipulator.strengthSmoothing));
						}
						if (thisManipulatorProperty.zeroVelocityStrength > 0f)
						{
							playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], Vector3.zero, t * thisManipulatorProperty.zeroVelocityStrength);
						}
					}
					if (thisManipulatorProperty.type == MANIPULATORPROPERTYTYPEC.MeshTarget && thisManipulatorProperty.meshTarget.initialized && playgroundParticles.playgroundCache.propertyId[p] == thisManipulator.manipulatorId)
					{
						if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.Lerp)
						{
							manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect));
							playgroundParticles.playgroundCache.position[p] = Vector3.Lerp(particlePosition, thisManipulatorProperty.meshTargetMatrix.MultiplyPoint3x4(thisManipulatorProperty.meshTarget.vertexPositions[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.meshTarget.vertexPositions.Length]), t * thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance / thisManipulator.strengthSmoothing);
							if (thisManipulatorProperty.zeroVelocityStrength > 0f)
							{
								playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], Vector3.zero, t * thisManipulatorProperty.zeroVelocityStrength);
							}
						}
						else if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.Linear)
						{
							manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect));
							playgroundParticles.playgroundCache.position[p] = Vector3.MoveTowards(particlePosition, thisManipulatorProperty.meshTargetMatrix.MultiplyPoint3x4(thisManipulatorProperty.meshTarget.vertexPositions[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.meshTarget.vertexPositions.Length]), t * thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance / thisManipulator.strengthSmoothing);
							if (thisManipulatorProperty.zeroVelocityStrength > 0f)
							{
								playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], Vector3.zero, t * thisManipulatorProperty.zeroVelocityStrength);
							}
						}
					}
					if (thisManipulatorProperty.type == MANIPULATORPROPERTYTYPEC.SkinnedMeshTarget && thisManipulatorProperty.skinnedMeshTarget.initialized && playgroundParticles.playgroundCache.propertyId[p] == thisManipulator.manipulatorId)
					{
						if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.Lerp)
						{
							manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect));
							playgroundParticles.playgroundCache.position[p] = Vector3.Lerp(particlePosition, thisManipulatorProperty.skinnedMeshTarget.vertexPositions[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.skinnedMeshTarget.vertexPositions.Length], t * (thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance) / thisManipulator.strengthSmoothing);
							if (thisManipulatorProperty.zeroVelocityStrength > 0f)
							{
								playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], Vector3.zero, t * thisManipulatorProperty.zeroVelocityStrength);
							}
						}
						else if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.Linear)
						{
							manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect));
							playgroundParticles.playgroundCache.position[p] = Vector3.MoveTowards(particlePosition, thisManipulatorProperty.skinnedMeshTarget.vertexPositions[playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.skinnedMeshTarget.vertexPositions.Length], t * (thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance) / thisManipulator.strengthSmoothing);
							if (thisManipulatorProperty.zeroVelocityStrength > 0f)
							{
								playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], Vector3.zero, t * thisManipulatorProperty.zeroVelocityStrength);
							}
						}
					}
					if (thisManipulatorProperty.type == MANIPULATORPROPERTYTYPEC.StateTarget && thisManipulatorProperty.stateTarget.initialized && !thisManipulatorProperty.stateTarget.IsInitializing() && playgroundParticles.playgroundCache.propertyId[p] == thisManipulator.manipulatorId)
					{
						if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.Lerp)
						{
							manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect));
							playgroundParticles.playgroundCache.position[p] = Vector3.Lerp(particlePosition, thisManipulatorProperty.stateTarget.stateTransformMx.MultiplyPoint3x4(thisManipulatorProperty.stateTarget.GetPosition(playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.stateTarget.positionLength)), t * (thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance) / thisManipulator.strengthSmoothing);
							if (thisManipulatorProperty.zeroVelocityStrength > 0f)
							{
								playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], Vector3.zero, t * thisManipulatorProperty.zeroVelocityStrength);
							}
						}
						else if (thisManipulatorProperty.transition == MANIPULATORPROPERTYTRANSITIONC.Linear)
						{
							manipulatorDistance = ((thisManipulator.strengthDistanceEffect <= 0f) ? 10f : (Vector3.SqrMagnitude(manipulatorPosition - particlePosition) / thisManipulator.strengthDistanceEffect));
							playgroundParticles.playgroundCache.position[p] = Vector3.MoveTowards(particlePosition, thisManipulatorProperty.stateTarget.stateTransformMx.MultiplyPoint3x4(thisManipulatorProperty.stateTarget.GetPosition(playgroundParticles.playgroundCache.propertyTarget[p] % thisManipulatorProperty.stateTarget.positionLength)), t * (thisManipulatorProperty.strength * manipulatorStrength / manipulatorDistance) / thisManipulator.strengthSmoothing);
							if (thisManipulatorProperty.zeroVelocityStrength > 0f)
							{
								playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], Vector3.zero, t * thisManipulatorProperty.zeroVelocityStrength);
							}
						}
					}
				}
			}
		}

		// Token: 0x0600094B RID: 2379 RVA: 0x0004345C File Offset: 0x0004165C
		public virtual void RefreshScatter()
		{
			System.Random random = new System.Random();
			for (int i = 0; i < this.particleCount; i++)
			{
				if (this.applySourceScatter)
				{
					if (this.sourceScatterMethod == MINMAXVECTOR3METHOD.Rectangular)
					{
						this.playgroundCache.scatterPosition[i] = PlaygroundParticlesC.RandomRange(random, this.sourceScatterMin, this.sourceScatterMax);
					}
					else if (this.sourceScatterMethod == MINMAXVECTOR3METHOD.RectangularLinear)
					{
						this.playgroundCache.scatterPosition[i] = Vector3.Lerp(this.sourceScatterMin, this.sourceScatterMax, (float)i * 1f / ((float)this.particleCount * 1f));
					}
					else if (this.sourceScatterMethod == MINMAXVECTOR3METHOD.Spherical)
					{
						this.playgroundCache.scatterPosition[i] = PlaygroundParticlesC.RandomRangeSpherical(random, this.sourceScatterMin.x, this.sourceScatterMax.x);
					}
					else if (this.sourceScatterMethod == MINMAXVECTOR3METHOD.SphericalLinear)
					{
						this.playgroundCache.scatterPosition[i] = PlaygroundParticlesC.RandomRangeSpherical(random, this.sourceScatterMin.x, this.sourceScatterMax.x, (float)i * 1f / ((float)this.particleCount * 1f));
					}
				}
				else
				{
					this.playgroundCache.scatterPosition[i] = Vector3.zero;
				}
			}
		}

		// Token: 0x0600094C RID: 2380 RVA: 0x000435D0 File Offset: 0x000417D0
		public static float RandomRange(System.Random random, float min, float max)
		{
			return min + (float)random.NextDouble() * (max - min);
		}

		// Token: 0x0600094D RID: 2381 RVA: 0x000435E0 File Offset: 0x000417E0
		public static Vector3 RandomRange(System.Random random, Vector3 min, Vector3 max)
		{
			return new Vector3(PlaygroundParticlesC.RandomRange(random, min.x, max.x), PlaygroundParticlesC.RandomRange(random, min.y, max.y), PlaygroundParticlesC.RandomRange(random, min.z, max.z));
		}

		// Token: 0x0600094E RID: 2382 RVA: 0x00043630 File Offset: 0x00041830
		public static Vector3 RandomRangeSpherical(System.Random random, float min, float max)
		{
			float f = 6.28318548f * PlaygroundParticlesC.RandomRange(random, 0f, 1f);
			float f2 = Mathf.Asin(2f * PlaygroundParticlesC.RandomRange(random, 0f, 1f) - 1f);
			float num = PlaygroundParticlesC.RandomRange(random, min, max);
			return new Vector3(Mathf.Cos(f2) * Mathf.Sin(f) * num, Mathf.Cos(f2) * Mathf.Cos(f) * num, Mathf.Sin(f2) * num);
		}

		// Token: 0x0600094F RID: 2383 RVA: 0x000436AC File Offset: 0x000418AC
		public static Vector3 RandomRangeSpherical(System.Random random, float min, float max, float step)
		{
			float f = 6.28318548f * PlaygroundParticlesC.RandomRange(random, 0f, 1f);
			float f2 = Mathf.Asin(2f * PlaygroundParticlesC.RandomRange(random, 0f, 1f) - 1f);
			float num = Mathf.Lerp(min, max, step);
			return new Vector3(Mathf.Cos(f2) * Mathf.Sin(f) * num, Mathf.Cos(f2) * Mathf.Cos(f) * num, Mathf.Sin(f2) * num);
		}

		// Token: 0x06000950 RID: 2384 RVA: 0x00043728 File Offset: 0x00041928
		public static Vector3 RandomRangeSpherical(System.Random random, float min, float max, float sectorA, float sectorB)
		{
			if (sectorB < 0f)
			{
				sectorB = 0f;
			}
			float f = 2f * sectorA * 3.14159274f * PlaygroundParticlesC.RandomRange(random, 0f, 1f);
			float f2 = Mathf.Asin(2f * sectorB * PlaygroundParticlesC.RandomRange(random, 0f, 1f) - 1f);
			float num = PlaygroundParticlesC.RandomRange(random, min, max);
			return new Vector3(Mathf.Cos(f2) * Mathf.Sin(f) * num, Mathf.Cos(f2) * Mathf.Cos(f) * num, Mathf.Sin(f2) * num);
		}

		// Token: 0x06000951 RID: 2385 RVA: 0x000437C0 File Offset: 0x000419C0
		public static Vector3 RandomRangeSpherical(System.Random random, float min, float max, float sectorA, float sectorB, float step)
		{
			if (sectorB < 0f)
			{
				sectorB = 0f;
			}
			float f = 2f * sectorA * 3.14159274f * PlaygroundParticlesC.RandomRange(random, 0f, 1f);
			float f2 = Mathf.Asin(2f * sectorB * PlaygroundParticlesC.RandomRange(random, 0f, 1f) - 1f);
			float num = Mathf.Lerp(min, max, step);
			return new Vector3(Mathf.Cos(f2) * Mathf.Sin(f) * num, Mathf.Cos(f2) * Mathf.Cos(f) * num, Mathf.Sin(f2) * num);
		}

		// Token: 0x06000952 RID: 2386 RVA: 0x0004385C File Offset: 0x00041A5C
		public static float[] RandomFloat(int length, float min, float max, System.Random random)
		{
			float[] array = new float[length];
			for (int i = 0; i < length; i++)
			{
				array[i] = PlaygroundParticlesC.RandomRange(random, min, max);
			}
			return array;
		}

		// Token: 0x06000953 RID: 2387 RVA: 0x00043890 File Offset: 0x00041A90
		public virtual void InactivateParticle(int particleId)
		{
			this.playgroundCache.simulate[particleId] = false;
			this.playgroundCache.rebirth[particleId] = false;
			this.playgroundCache.isNonBirthed[particleId] = true;
			this.playgroundCache.isFirstLoop[particleId] = true;
			this.playgroundCache.isCalculatedThisFrame[particleId] = false;
			this.playgroundCache.position[particleId] = PlaygroundC.initialTargetPosition;
			this.playgroundCache.targetPosition[particleId] = this.playgroundCache.position[particleId];
			this.playgroundCache.previousTargetPosition[particleId] = this.playgroundCache.targetPosition[particleId];
			this.playgroundCache.velocity[particleId] = Vector3.zero;
			this.particleCache[particleId].position = this.playgroundCache.position[particleId];
			this.particleCache[particleId].startSize = 0f;
			this.playgroundCache.changedByProperty[particleId] = false;
			this.playgroundCache.changedByPropertyColor[particleId] = false;
			this.playgroundCache.changedByPropertyColorLerp[particleId] = false;
			this.playgroundCache.changedByPropertyColorKeepAlpha[particleId] = false;
			this.playgroundCache.changedByPropertySize[particleId] = false;
			this.playgroundCache.changedByPropertyTarget[particleId] = false;
			this.playgroundCache.changedByPropertyDeath[particleId] = false;
			this.playgroundCache.propertyTarget[particleId] = 0;
			this.playgroundCache.propertyId[particleId] = 0;
			this.playgroundCache.propertyColorId[particleId] = 0;
			this.playgroundCache.manipulatorId[particleId] = 0;
		}

		// Token: 0x06000954 RID: 2388 RVA: 0x00043A48 File Offset: 0x00041C48
		public virtual void InactivateParticles()
		{
			for (int i = 0; i < this.particleCount; i++)
			{
				this.InactivateParticle(i);
			}
			this.hasActiveParticles = false;
			this.threadHadNoActiveParticles = true;
			this.isDoneThread = true;
			if (this.particleCache != null && this.particleCache.Length > 0)
			{
				this.shurikenParticleSystem.SetParticles(this.particleCache, this.particleCache.Length);
			}
		}

		// Token: 0x06000955 RID: 2389 RVA: 0x00043ABC File Offset: 0x00041CBC
		public static void Rebirth(PlaygroundParticlesC playgroundParticles, int p, System.Random random)
		{
			if (!playgroundParticles.hasActiveParticles)
			{
				return;
			}
			playgroundParticles.playgroundCache.rebirth[p] = (playgroundParticles.source == SOURCEC.Script || (playgroundParticles.emit && (playgroundParticles.loop || playgroundParticles.playgroundCache.isNonBirthed[p]) && playgroundParticles.playgroundCache.emission[p]));
			playgroundParticles.playgroundCache.isFirstLoop[p] = playgroundParticles.playgroundCache.isNonBirthed[p];
			playgroundParticles.playgroundCache.isNonBirthed[p] = false;
			playgroundParticles.playgroundCache.life[p] = 0f;
			playgroundParticles.playgroundCache.birth[p] = playgroundParticles.playgroundCache.death[p];
			playgroundParticles.playgroundCache.death[p] += playgroundParticles.lifetime;
			playgroundParticles.playgroundCache.velocity[p] = Vector3.zero;
			playgroundParticles.playgroundCache.noForce[p] = false;
			if (playgroundParticles.hasCollisionCache)
			{
				playgroundParticles.collisionCache.Reset(p);
			}
			playgroundParticles.playgroundCache.changedByProperty[p] = false;
			playgroundParticles.playgroundCache.changedByPropertyColor[p] = false;
			playgroundParticles.playgroundCache.changedByPropertyColorLerp[p] = false;
			playgroundParticles.playgroundCache.changedByPropertyColorKeepAlpha[p] = false;
			playgroundParticles.playgroundCache.changedByPropertySize[p] = false;
			playgroundParticles.playgroundCache.changedByPropertyTarget[p] = false;
			playgroundParticles.playgroundCache.changedByPropertyDeath[p] = false;
			playgroundParticles.playgroundCache.propertyTarget[p] = 0;
			playgroundParticles.playgroundCache.propertyId[p] = 0;
			playgroundParticles.playgroundCache.propertyColorId[p] = 0;
			playgroundParticles.playgroundCache.manipulatorId[p] = 0;
			if (playgroundParticles.applyRandomSizeOnRebirth)
			{
				playgroundParticles.playgroundCache.initialSize[p] = PlaygroundParticlesC.RandomRange(random, playgroundParticles.sizeMin, playgroundParticles.sizeMax);
			}
			if (!playgroundParticles.onlySourcePositioning && !playgroundParticles.onlyLifetimePositioning)
			{
				if (playgroundParticles.applyInitialVelocity)
				{
					if (playgroundParticles.applyRandomInitialVelocityOnRebirth)
					{
						if (playgroundParticles.initialVelocityMethod == MINMAXVECTOR3METHOD.Spherical)
						{
							playgroundParticles.playgroundCache.initialVelocity[p] = PlaygroundParticlesC.RandomRangeSpherical(random, playgroundParticles.initialVelocityMin.x, playgroundParticles.initialVelocityMax.x);
						}
						else if (playgroundParticles.initialVelocityMethod == MINMAXVECTOR3METHOD.SphericalLinear)
						{
							playgroundParticles.playgroundCache.initialVelocity[p] = PlaygroundParticlesC.RandomRangeSpherical(random, playgroundParticles.initialVelocityMin.x, playgroundParticles.initialVelocityMax.x, (float)p * 1f / ((float)playgroundParticles.particleCount * 1f));
						}
						else if (playgroundParticles.initialVelocityMethod == MINMAXVECTOR3METHOD.RectangularLinear)
						{
							playgroundParticles.playgroundCache.initialVelocity[p] = Vector3.Lerp(playgroundParticles.initialVelocityMin, playgroundParticles.initialVelocityMax, (float)p * 1f / ((float)playgroundParticles.particleCount * 1f));
						}
						else
						{
							playgroundParticles.playgroundCache.initialVelocity[p] = PlaygroundParticlesC.RandomRange(random, playgroundParticles.initialVelocityMin, playgroundParticles.initialVelocityMax);
						}
					}
					playgroundParticles.playgroundCache.velocity[p] = playgroundParticles.playgroundCache.initialVelocity[p];
					if (playgroundParticles.applyInitialVelocityShape)
					{
						playgroundParticles.playgroundCache.velocity[p] = Vector3.Scale(playgroundParticles.playgroundCache.velocity[p], playgroundParticles.initialVelocityShape.Evaluate((float)p * 1f / ((float)playgroundParticles.particleCount * 1f), playgroundParticles.initialVelocityShapeScale));
					}
				}
				if (playgroundParticles.applyInitialLocalVelocity && playgroundParticles.source != SOURCEC.Script)
				{
					if (playgroundParticles.initialLocalVelocityMethod == MINMAXVECTOR3METHOD.Spherical)
					{
						playgroundParticles.playgroundCache.initialLocalVelocity[p] = PlaygroundParticlesC.RandomRangeSpherical(random, playgroundParticles.initialLocalVelocityMin.x, playgroundParticles.initialLocalVelocityMax.x);
					}
					else if (playgroundParticles.initialLocalVelocityMethod == MINMAXVECTOR3METHOD.SphericalLinear)
					{
						playgroundParticles.playgroundCache.initialLocalVelocity[p] = PlaygroundParticlesC.RandomRangeSpherical(random, playgroundParticles.initialLocalVelocityMin.x, playgroundParticles.initialLocalVelocityMax.x, (float)p * 1f / ((float)playgroundParticles.particleCount * 1f));
					}
					else if (playgroundParticles.initialLocalVelocityMethod == MINMAXVECTOR3METHOD.RectangularLinear)
					{
						playgroundParticles.playgroundCache.initialLocalVelocity[p] = Vector3.Lerp(playgroundParticles.initialLocalVelocityMin, playgroundParticles.initialLocalVelocityMax, (float)p * 1f / ((float)playgroundParticles.particleCount * 1f));
					}
					else
					{
						playgroundParticles.playgroundCache.initialLocalVelocity[p] = PlaygroundParticlesC.RandomRange(random, playgroundParticles.initialLocalVelocityMin, playgroundParticles.initialLocalVelocityMax);
					}
					playgroundParticles.playgroundCache.velocity[p] += playgroundParticles.playgroundCache.targetDirection[p];
					if (playgroundParticles.applyInitialVelocityShape)
					{
						playgroundParticles.playgroundCache.velocity[p] = Vector3.Scale(playgroundParticles.playgroundCache.velocity[p], playgroundParticles.initialVelocityShape.Evaluate((float)p * 1f / ((float)playgroundParticles.particleCount * 1f), playgroundParticles.initialVelocityShapeScale));
					}
				}
				playgroundParticles.particleCache[p].velocity = ((!playgroundParticles.renderModeStretch || !playgroundParticles.applyStretchStartDirection) ? Vector3.zero : playgroundParticles.stretchStartDirection);
			}
			if (playgroundParticles.source == SOURCEC.Script)
			{
				if (!playgroundParticles.onlySourcePositioning && !playgroundParticles.onlyLifetimePositioning)
				{
					playgroundParticles.playgroundCache.velocity[p] += playgroundParticles.scriptedEmissionVelocity;
				}
				playgroundParticles.playgroundCache.targetPosition[p] = playgroundParticles.scriptedEmissionPosition;
				playgroundParticles.particleCache[p].velocity = ((!playgroundParticles.renderModeStretch || !playgroundParticles.applyStretchStartDirection) ? Vector3.zero : playgroundParticles.stretchStartDirection);
			}
			if (playgroundParticles.scriptedLifetime == 0f)
			{
				if (playgroundParticles.applyRandomLifetimeOnRebirth)
				{
					if (playgroundParticles.lifetimeValueMethod == VALUEMETHOD.Constant)
					{
						playgroundParticles.playgroundCache.lifetimeSubtraction[p] = 0f;
					}
					else
					{
						playgroundParticles.playgroundCache.lifetimeSubtraction[p] = playgroundParticles.lifetime - PlaygroundParticlesC.RandomRange(random, playgroundParticles.lifetimeMin, playgroundParticles.lifetime);
					}
				}
				if (!playgroundParticles.syncPositionsOnMainThread)
				{
					playgroundParticles.particleCache[p].lifetime = playgroundParticles.lifetime;
				}
				playgroundParticles.particleCache[p].startLifetime = playgroundParticles.lifetime - playgroundParticles.playgroundCache.lifetimeSubtraction[p];
			}
			else
			{
				playgroundParticles.playgroundCache.lifetimeSubtraction[p] = 0f;
				if (!playgroundParticles.syncPositionsOnMainThread)
				{
					playgroundParticles.particleCache[p].lifetime = playgroundParticles.scriptedLifetime;
				}
				playgroundParticles.particleCache[p].startLifetime = playgroundParticles.scriptedLifetime;
			}
			if (playgroundParticles.playgroundCache.rebirth[p])
			{
				playgroundParticles.SetParticleColorInternal(p, playgroundParticles.GetParticleColor(p, 0f, (float)p * 1f / ((float)playgroundParticles.particleCount * 1f)));
				if (playgroundParticles.applySourceScatter && playgroundParticles.source != SOURCEC.Script)
				{
					if (playgroundParticles.playgroundCache.scatterPosition[p] == Vector3.zero || playgroundParticles.applyRandomScatterOnRebirth)
					{
						if (playgroundParticles.sourceScatterMethod == MINMAXVECTOR3METHOD.Rectangular)
						{
							playgroundParticles.playgroundCache.scatterPosition[p] = PlaygroundParticlesC.RandomRange(random, playgroundParticles.sourceScatterMin, playgroundParticles.sourceScatterMax);
						}
						else if (playgroundParticles.sourceScatterMethod == MINMAXVECTOR3METHOD.RectangularLinear)
						{
							playgroundParticles.playgroundCache.scatterPosition[p] = Vector3.Lerp(playgroundParticles.sourceScatterMin, playgroundParticles.sourceScatterMax, (float)p * 1f / ((float)playgroundParticles.particleCount * 1f));
						}
						else if (playgroundParticles.sourceScatterMethod == MINMAXVECTOR3METHOD.SphericalLinear)
						{
							playgroundParticles.playgroundCache.scatterPosition[p] = PlaygroundParticlesC.RandomRangeSpherical(random, playgroundParticles.sourceScatterMin.x, playgroundParticles.sourceScatterMax.x, (float)p * 1f / ((float)playgroundParticles.particleCount * 1f));
						}
						else
						{
							playgroundParticles.playgroundCache.scatterPosition[p] = PlaygroundParticlesC.RandomRangeSpherical(random, playgroundParticles.sourceScatterMin.x, playgroundParticles.sourceScatterMax.x);
						}
					}
				}
				else
				{
					playgroundParticles.playgroundCache.scatterPosition[p] = Vector3.zero;
				}
				if (!playgroundParticles.onlyLifetimePositioning)
				{
					playgroundParticles.playgroundCache.position[p] = playgroundParticles.playgroundCache.targetPosition[p];
					if (!playgroundParticles.syncPositionsOnMainThread)
					{
						playgroundParticles.particleCache[p].position = playgroundParticles.playgroundCache.targetPosition[p];
					}
					playgroundParticles.playgroundCache.previousParticlePosition[p] = playgroundParticles.playgroundCache.targetPosition[p];
					playgroundParticles.playgroundCache.collisionParticlePosition[p] = playgroundParticles.playgroundCache.targetPosition[p];
				}
				else if (!playgroundParticles.onlySourcePositioning)
				{
					if (playgroundParticles.lifetimePositioningUsesSourceDirection && playgroundParticles.source != SOURCEC.Script)
					{
						playgroundParticles.playgroundCache.position[p] = playgroundParticles.playgroundCache.targetPosition[p] + playgroundParticles.playgroundCache.targetDirection[p];
					}
					else if (!playgroundParticles.applyLifetimePositioningPositionScale)
					{
						playgroundParticles.playgroundCache.position[p] = playgroundParticles.playgroundCache.targetPosition[p] + playgroundParticles.lifetimePositioning.Evaluate(0f, playgroundParticles.lifetimePositioningScale);
					}
					else
					{
						playgroundParticles.playgroundCache.position[p] = playgroundParticles.playgroundCache.targetPosition[p] + playgroundParticles.lifetimePositioning.Evaluate(0f, playgroundParticles.lifetimePositioningScale) * playgroundParticles.lifetimePositioningPositionScale.Evaluate(0f);
					}
					if (!playgroundParticles.syncPositionsOnMainThread)
					{
						playgroundParticles.particleCache[p].position = playgroundParticles.playgroundCache.targetPosition[p];
					}
					playgroundParticles.playgroundCache.previousParticlePosition[p] = playgroundParticles.playgroundCache.targetPosition[p];
					playgroundParticles.playgroundCache.collisionParticlePosition[p] = playgroundParticles.playgroundCache.targetPosition[p];
				}
				if (playgroundParticles.applyInitialColorOnRebirth)
				{
					playgroundParticles.SetParticleColorInternal(p, playgroundParticles.playgroundCache.initialColor[p]);
					playgroundParticles.playgroundCache.color[p] = playgroundParticles.playgroundCache.initialColor[p];
				}
			}
			else
			{
				playgroundParticles.particleCache[p].position = PlaygroundC.initialTargetPosition;
			}
			if (playgroundParticles.applyRandomRotationOnRebirth && !playgroundParticles.rotateTowardsDirection)
			{
				playgroundParticles.playgroundCache.initialRotation[p] = PlaygroundParticlesC.RandomRange(random, playgroundParticles.initialRotationMin, playgroundParticles.initialRotationMax);
			}
			if (!playgroundParticles.rotateTowardsDirection)
			{
				playgroundParticles.playgroundCache.rotation[p] = playgroundParticles.playgroundCache.initialRotation[p];
			}
			else
			{
				Vector3 b;
				if (!playgroundParticles.onlySourcePositioning && playgroundParticles.onlyLifetimePositioning)
				{
					b = playgroundParticles.playgroundCache.position[p] + playgroundParticles.lifetimePositioning.Evaluate(0.01f, playgroundParticles.lifetimePositioningScale) - playgroundParticles.playgroundCache.position[p];
				}
				else
				{
					b = playgroundParticles.playgroundCache.velocity[p];
				}
				playgroundParticles.playgroundCache.rotation[p] = playgroundParticles.playgroundCache.initialRotation[p] + PlaygroundParticlesC.SignedAngle(Vector3.up, b, playgroundParticles.rotationNormal);
			}
			if (!playgroundParticles.syncPositionsOnMainThread)
			{
				playgroundParticles.particleCache[p].rotation = playgroundParticles.playgroundCache.rotation[p];
			}
			if (playgroundParticles.applyLifetimeSize && !playgroundParticles.applyParticleArraySize)
			{
				playgroundParticles.playgroundCache.size[p] = playgroundParticles.playgroundCache.initialSize[p] * playgroundParticles.lifetimeSize.Evaluate(0f) * playgroundParticles.scale;
			}
			else if (playgroundParticles.applyLifetimeSize && playgroundParticles.applyParticleArraySize)
			{
				playgroundParticles.playgroundCache.size[p] = playgroundParticles.playgroundCache.initialSize[p] * playgroundParticles.lifetimeSize.Evaluate(0f) * playgroundParticles.particleArraySize.Evaluate((float)p * 1f / ((float)playgroundParticles.particleCount * 1f)) * playgroundParticles.scale;
			}
			else if (playgroundParticles.applyParticleArraySize)
			{
				playgroundParticles.playgroundCache.size[p] = playgroundParticles.playgroundCache.initialSize[p] * playgroundParticles.particleArraySize.Evaluate((float)p * 1f / ((float)playgroundParticles.particleCount * 1f)) * playgroundParticles.scale;
			}
			else
			{
				playgroundParticles.playgroundCache.size[p] = playgroundParticles.playgroundCache.initialSize[p] * playgroundParticles.scale;
			}
			if (!playgroundParticles.syncPositionsOnMainThread)
			{
				playgroundParticles.particleCache[p].startSize = ((playgroundParticles.playgroundCache.maskAlpha[p] <= 0f) ? 0f : playgroundParticles.playgroundCache.size[p]);
			}
			if (playgroundParticles.colorSource == COLORSOURCEC.LifetimeColors && playgroundParticles.lifetimeColors.Count > 0)
			{
				playgroundParticles.lifetimeColorId++;
				playgroundParticles.lifetimeColorId %= playgroundParticles.lifetimeColors.Count;
				playgroundParticles.playgroundCache.lifetimeColorId[p] = playgroundParticles.lifetimeColorId;
			}
			if (playgroundParticles.calculateManipulatorOnRebirth)
			{
				for (int i = 0; i < playgroundParticles.manipulators.Count; i++)
				{
					if (playgroundParticles.manipulators[i].transform != null)
					{
						PlaygroundParticlesC.CalculateManipulator(playgroundParticles, playgroundParticles.manipulators[i], p, playgroundParticles.t, playgroundParticles.playgroundCache.life[p], playgroundParticles.playgroundCache.position[p], ((!playgroundParticles.localSpace) ? playgroundParticles.manipulators[i].transform.position : playgroundParticles.manipulators[i].transform.localPosition) + playgroundParticles.manipulatorFix, playgroundParticles.localSpace);
					}
				}
			}
			if (playgroundParticles.events.Count > 0 && playgroundParticles.playgroundCache.rebirth[p])
			{
				playgroundParticles.SendEvent(EVENTTYPEC.Birth, p);
			}
			if (playgroundParticles.hasEventManipulatorLocal)
			{
				for (int j = 0; j < playgroundParticles.manipulators.Count; j++)
				{
					if (playgroundParticles.manipulators[j].trackParticles && playgroundParticles.manipulators[j].sendEventBirth && playgroundParticles.manipulators[j].Contains(playgroundParticles.playgroundCache.targetPosition[p], playgroundParticles.manipulators[j].transform.position))
					{
						playgroundParticles.UpdateEventParticle(playgroundParticles.manipulators[j].manipulatorEventParticle, p);
						playgroundParticles.manipulators[j].SendParticleEventBirth();
					}
				}
			}
			if (playgroundParticles.hasEventManipulatorGlobal)
			{
				for (int k = 0; k < PlaygroundC.reference.manipulators.Count; k++)
				{
					if (PlaygroundC.reference.manipulators[k].trackParticles && PlaygroundC.reference.manipulators[k].sendEventBirth && PlaygroundC.reference.manipulators[k].Contains(playgroundParticles.playgroundCache.targetPosition[p], PlaygroundC.reference.manipulators[k].transform.position))
					{
						playgroundParticles.UpdateEventParticle(PlaygroundC.reference.manipulators[k].manipulatorEventParticle, p);
						PlaygroundC.reference.manipulators[k].SendParticleEventBirth();
					}
				}
			}
		}

		// Token: 0x06000956 RID: 2390 RVA: 0x00044C20 File Offset: 0x00042E20
		public virtual void SendEvent(EVENTTYPEC eventType, int p)
		{
			this.SendEvent(eventType, p, this.playgroundCache.velocity[p], null, null, null);
		}

		// Token: 0x06000957 RID: 2391 RVA: 0x00044C44 File Offset: 0x00042E44
		public virtual void SendEvent(EVENTTYPEC eventType, int p, Vector3 preEventVelocity)
		{
			this.SendEvent(eventType, p, preEventVelocity, null, null, null);
		}

		// Token: 0x06000958 RID: 2392 RVA: 0x00044C54 File Offset: 0x00042E54
		public virtual void SendEvent(EVENTTYPEC eventType, int p, Vector3 preEventVelocity, Transform collisionTransform)
		{
			this.SendEvent(eventType, p, preEventVelocity, collisionTransform, null, null);
		}

		// Token: 0x06000959 RID: 2393 RVA: 0x00044C64 File Offset: 0x00042E64
		public virtual void SendEvent(EVENTTYPEC eventType, int p, Vector3 preEventVelocity, Transform collisionTransform, Collider collisionCollider)
		{
			this.SendEvent(eventType, p, preEventVelocity, collisionTransform, collisionCollider, null);
		}

		// Token: 0x0600095A RID: 2394 RVA: 0x00044C74 File Offset: 0x00042E74
		public virtual void SendEvent(EVENTTYPEC eventType, int p, Vector3 preEventVelocity, Transform collisionTransform, Collider2D collisionCollider2D)
		{
			this.SendEvent(eventType, p, preEventVelocity, collisionTransform, null, collisionCollider2D);
		}

		// Token: 0x0600095B RID: 2395 RVA: 0x00044C84 File Offset: 0x00042E84
		public virtual void SendEvent(EVENTTYPEC eventType, int p, Vector3 preEventVelocity, Transform collisionTransform, Collider collisionCollider, Collider2D collisionCollider2D)
		{
			Vector3 givePosition = Vector3.zero;
			Vector3 vector = Vector3.zero;
			Color32 giveColor = Color.white;
			for (int i = 0; i < this.events.Count; i++)
			{
				if (this.events[i].enabled && this.events[i].eventType == eventType)
				{
					if (this.events[i].eventType == EVENTTYPEC.Collision && this.events[i].collisionThreshold > preEventVelocity.sqrMagnitude)
					{
						return;
					}
					switch (this.events[i].eventInheritancePosition)
					{
					case EVENTINHERITANCEC.User:
						givePosition = this.events[i].eventPosition;
						break;
					case EVENTINHERITANCEC.Particle:
						givePosition = ((eventType != EVENTTYPEC.Death) ? this.playgroundCache.position[p] : this.playgroundCache.previousParticlePosition[p]);
						break;
					case EVENTINHERITANCEC.Source:
						givePosition = this.playgroundCache.targetPosition[p];
						break;
					}
					switch (this.events[i].eventInheritanceVelocity)
					{
					case EVENTINHERITANCEC.User:
						vector = this.events[i].eventVelocity;
						break;
					case EVENTINHERITANCEC.Particle:
						vector = this.playgroundCache.velocity[p];
						break;
					case EVENTINHERITANCEC.Source:
						if (this.applyInitialLocalVelocity)
						{
							vector = this.playgroundCache.initialLocalVelocity[p];
						}
						if (this.applyInitialVelocity)
						{
							vector += this.playgroundCache.initialVelocity[p];
						}
						if (this.applyLifetimeVelocity)
						{
							vector += this.lifetimeVelocity.Evaluate(Mathf.Clamp01(this.playgroundCache.life[p] / this.lifetime), this.lifetimeVelocityScale);
						}
						if (this.applyInitialVelocityShape)
						{
							vector = Vector3.Scale(vector, this.initialVelocityShape.Evaluate((float)p * 1f / ((float)this.particleCount * 1f), this.initialVelocityShapeScale));
						}
						break;
					}
					vector *= this.events[i].velocityMultiplier;
					switch (this.events[i].eventInheritanceColor)
					{
					case EVENTINHERITANCEC.User:
						giveColor = this.events[i].eventColor;
						break;
					case EVENTINHERITANCEC.Particle:
						giveColor = this.playgroundCache.color[p];
						break;
					case EVENTINHERITANCEC.Source:
						giveColor = this.playgroundCache.initialColor[p];
						break;
					}
					if (this.events[i].broadcastType == EVENTBROADCASTC.EventListeners || this.events[i].broadcastType == EVENTBROADCASTC.Both)
					{
						this.UpdateEventParticle(this.eventParticle, p);
						this.eventParticle.collisionCollider = collisionCollider;
						this.eventParticle.collisionCollider2D = collisionCollider2D;
						this.eventParticle.collisionTransform = collisionTransform;
						this.events[i].SendParticleEvent(this.eventParticle);
						if (this.events[i].sendToManager)
						{
							switch (this.events[i].eventType)
							{
							case EVENTTYPEC.Birth:
								PlaygroundC.SendParticleEventBirth(this.eventParticle);
								break;
							case EVENTTYPEC.Death:
								PlaygroundC.SendParticleEventDeath(this.eventParticle);
								break;
							case EVENTTYPEC.Collision:
								PlaygroundC.SendParticleEventCollision(this.eventParticle);
								break;
							case EVENTTYPEC.Time:
								PlaygroundC.SendParticleEventTime(this.eventParticle);
								break;
							}
						}
					}
					if (this.events[i].initializedTarget && (this.events[i].broadcastType == EVENTBROADCASTC.Target || this.events[i].broadcastType == EVENTBROADCASTC.Both))
					{
						this.events[i].target.ThreadSafeEmit(givePosition, vector, giveColor);
					}
				}
			}
		}

		// Token: 0x0600095C RID: 2396 RVA: 0x000450D4 File Offset: 0x000432D4
		public virtual bool UpdateEventParticle(PlaygroundEventParticle eParticle, int p)
		{
			if (p >= this.particleCount || p < 0)
			{
				return false;
			}
			eParticle.particleSystemId = this.particleSystemId;
			eParticle.particleId = p;
			eParticle.birth = this.playgroundCache.birth[p];
			eParticle.birthDelay = this.playgroundCache.birthDelay[p];
			eParticle.changedByProperty = this.playgroundCache.changedByProperty[p];
			eParticle.changedByPropertyColor = this.playgroundCache.changedByPropertyColor[p];
			eParticle.changedByPropertyColorKeepAlpha = this.playgroundCache.changedByPropertyColorKeepAlpha[p];
			eParticle.changedByPropertyColorLerp = this.playgroundCache.changedByPropertyColorLerp[p];
			eParticle.changedByPropertyDeath = this.playgroundCache.changedByPropertyDeath[p];
			eParticle.changedByPropertySize = this.playgroundCache.changedByPropertySize[p];
			eParticle.changedByPropertyTarget = this.playgroundCache.changedByPropertyTarget[p];
			eParticle.collisionParticlePosition = this.playgroundCache.collisionParticlePosition[p];
			eParticle.color = this.playgroundCache.color[p];
			eParticle.scriptedColor = this.playgroundCache.scriptedColor[p];
			eParticle.death = this.playgroundCache.death[p];
			eParticle.emission = this.playgroundCache.emission[p];
			eParticle.initialColor = this.playgroundCache.initialColor[p];
			eParticle.initialLocalVelocity = this.playgroundCache.initialLocalVelocity[p];
			eParticle.initialRotation = this.playgroundCache.initialRotation[p];
			eParticle.initialSize = this.playgroundCache.initialSize[p];
			eParticle.initialVelocity = this.playgroundCache.initialVelocity[p];
			eParticle.initialLocalVelocity = this.playgroundCache.initialLocalVelocity[p];
			eParticle.life = this.playgroundCache.life[p];
			eParticle.lifetimeColorId = this.playgroundCache.lifetimeColorId[p];
			eParticle.noForce = this.playgroundCache.noForce[p];
			eParticle.totalLifetime = this.playgroundCache.death[p] - this.playgroundCache.birth[p] - this.playgroundCache.lifetimeSubtraction[p];
			eParticle.lifetimeOffset = this.playgroundCache.lifetimeOffset[p];
			eParticle.localSpaceMovementCompensation = this.playgroundCache.localSpaceMovementCompensation[p];
			eParticle.position = this.playgroundCache.position[p];
			eParticle.previousParticlePosition = this.playgroundCache.previousParticlePosition[p];
			eParticle.previousTargetPosition = this.playgroundCache.previousTargetPosition[p];
			eParticle.propertyColorId = this.playgroundCache.propertyColorId[p];
			eParticle.propertyId = this.playgroundCache.propertyId[p];
			eParticle.excludeFromManipulatorId = this.playgroundCache.excludeFromManipulatorId[p];
			eParticle.propertyTarget = this.playgroundCache.propertyTarget[p];
			eParticle.rebirth = this.playgroundCache.rebirth[p];
			eParticle.rotation = this.playgroundCache.rotation[p];
			eParticle.rotationSpeed = this.playgroundCache.rotationSpeed[p];
			eParticle.scatterPosition = this.playgroundCache.scatterPosition[p];
			eParticle.size = this.playgroundCache.size[p];
			eParticle.targetDirection = this.playgroundCache.targetDirection[p];
			eParticle.targetPosition = this.playgroundCache.targetPosition[p];
			eParticle.velocity = this.playgroundCache.velocity[p];
			eParticle.isMasked = this.playgroundCache.isMasked[p];
			eParticle.maskAlpha = this.playgroundCache.maskAlpha[p];
			eParticle.isFirstLoop = this.playgroundCache.isFirstLoop[p];
			eParticle.isNonBirthed = this.playgroundCache.isNonBirthed[p];
			return true;
		}

		// Token: 0x0600095D RID: 2397 RVA: 0x00045504 File Offset: 0x00043704
		public virtual void RemoveState(int i)
		{
			int num = this.activeState;
			num = num % this.states.Count - 1;
			if (num < 0)
			{
				num = 0;
			}
			this.states[num].Initialize();
			this.activeState = num;
			this.states.RemoveAt(i);
		}

		// Token: 0x0600095E RID: 2398 RVA: 0x00045558 File Offset: 0x00043758
		public static void Clear(PlaygroundParticlesC playgroundParticles)
		{
			playgroundParticles.inTransition = false;
			playgroundParticles.particleCache = new ParticleSystem.Particle[0];
			playgroundParticles.playgroundCache = null;
			playgroundParticles.shurikenParticleSystem.SetParticles(playgroundParticles.particleCache, 0);
			playgroundParticles.shurikenParticleSystem.Clear();
		}

		// Token: 0x0600095F RID: 2399 RVA: 0x00045594 File Offset: 0x00043794
		public virtual void Save()
		{
			if (this.isSnapshot)
			{
				global::Debug.Log("A snapshot can't store snapshot data within itself.", base.gameObject);
				return;
			}
			this.SaveRoutine("New Snapshot " + (this.snapshots.Count + 1).ToString());
		}

		// Token: 0x06000960 RID: 2400 RVA: 0x000455E4 File Offset: 0x000437E4
		public virtual void Save(string saveName)
		{
			if (this.isSnapshot)
			{
				global::Debug.Log("A snapshot can't store snapshot data within itself.", base.gameObject);
				return;
			}
			this.SaveRoutine(saveName);
		}

		// Token: 0x06000961 RID: 2401 RVA: 0x0004560C File Offset: 0x0004380C
		public virtual void SaveAsynchronous()
		{
			if (this.isSnapshot)
			{
				global::Debug.Log("A snapshot can't store snapshot data within itself.", base.gameObject);
				return;
			}
			base.StartCoroutine(this.SaveAsynchronousRoutine("New Snapshot " + (this.snapshots.Count + 1).ToString()));
		}

		// Token: 0x06000962 RID: 2402 RVA: 0x00045664 File Offset: 0x00043864
		public virtual void SaveAsynchronous(string saveName)
		{
			if (this.isSnapshot)
			{
				global::Debug.Log("A snapshot can't store snapshot data within itself.", base.gameObject);
				return;
			}
			base.StartCoroutine(this.SaveAsynchronousRoutine(saveName));
		}

		// Token: 0x06000963 RID: 2403 RVA: 0x00045690 File Offset: 0x00043890
		public virtual void SaveRoutine(string saveName)
		{
			this.isSaving = true;
			PlaygroundSave playgroundSave = new PlaygroundSave();
			playgroundSave.settings = PlaygroundC.Particle();
			playgroundSave.settings.isSnapshot = true;
			playgroundSave.Save(this);
			playgroundSave.settings.transform.parent = this.particleSystemTransform;
			playgroundSave.settings.transform.name = saveName;
			playgroundSave.settings.timeOfSnapshot = this.localTime;
			playgroundSave.name = saveName;
			playgroundSave.time = this.localTime;
			playgroundSave.particleCount = this.particleCount;
			playgroundSave.lifetime = this.lifetime;
			playgroundSave.version = PlaygroundC.version;
			this.snapshots.Add(playgroundSave);
			PlaygroundC.reference.particleSystems.Remove(playgroundSave.settings);
			this.isSaving = false;
		}

		// Token: 0x06000964 RID: 2404 RVA: 0x00045760 File Offset: 0x00043960
		public virtual IEnumerator SaveAsynchronousRoutine(string saveName)
		{
			this.isSaving = true;
			PlaygroundSave data = new PlaygroundSave();
			data.settings = PlaygroundC.Particle();
			data.settings.isSnapshot = true;
			yield return null;
			data.SaveAsync(this);
			while (data.IsSaving())
			{
				yield return null;
			}
			data.settings.transform.parent = this.particleSystemTransform;
			data.settings.transform.name = saveName;
			data.settings.timeOfSnapshot = this.localTime;
			data.name = saveName;
			data.time = this.localTime;
			data.particleCount = this.particleCount;
			data.lifetime = this.lifetime;
			data.version = PlaygroundC.version;
			this.snapshots.Add(data);
			PlaygroundC.reference.particleSystems.Remove(data.settings);
			this.isSaving = false;
			yield break;
		}

		// Token: 0x06000965 RID: 2405 RVA: 0x0004578C File Offset: 0x0004398C
		public virtual void Load(int loadPointer)
		{
			if (this.snapshots.Count > 0)
			{
				loadPointer %= this.snapshots.Count;
				base.StartCoroutine(this.LoadRoutine(loadPointer, 0));
			}
			else
			{
				global::Debug.Log("No data to load from. Please use PlaygroundParticlesC.Save() to store a particle system's current state.", this.particleSystemGameObject);
			}
		}

		// Token: 0x06000966 RID: 2406 RVA: 0x000457E0 File Offset: 0x000439E0
		public virtual void Load(string loadName)
		{
			if (this.snapshots.Count > 0)
			{
				for (int i = 0; i < this.snapshots.Count; i++)
				{
					if (this.snapshots[i].name == loadName.Trim())
					{
						base.StartCoroutine(this.LoadRoutine(i, 0));
						return;
					}
				}
			}
			else
			{
				global::Debug.Log("No data found with the name " + loadName + ".", this.particleSystemGameObject);
			}
		}

		// Token: 0x06000967 RID: 2407 RVA: 0x0004586C File Offset: 0x00043A6C
		public virtual void LoadAndApplyMask(int loadPointer, int loadMask)
		{
			if (this.snapshots.Count > 0)
			{
				loadPointer %= this.snapshots.Count;
				base.StartCoroutine(this.LoadRoutine(loadPointer, loadMask));
			}
			else
			{
				global::Debug.Log("No data to load from. Please use PlaygroundParticlesC.Save() to store a particle system's current state.", this.particleSystemGameObject);
			}
		}

		// Token: 0x06000968 RID: 2408 RVA: 0x000458C0 File Offset: 0x00043AC0
		public virtual IEnumerator LoadRoutine(int loadPointer, int mask)
		{
			if (this.loadTransition && this.loadTransitionTime > 0f && this.snapshots[loadPointer].transitionMultiplier > 0f && this.transitionAvailable && !this.isYieldRefreshing)
			{
				if (this.snapshots[loadPointer].loadMaterial && !this.snapshots[loadPointer].setMaterialAfterTransition && this.snapshots[loadPointer].settings.particleSystemRenderer.sharedMaterial != null)
				{
					this.particleSystemRenderer.sharedMaterial = this.snapshots[loadPointer].settings.particleSystemRenderer.sharedMaterial;
				}
				if (mask > 0)
				{
					mask = Mathf.Clamp(mask, 0, this.snapshots[loadPointer].settings.particleCount);
					if (this.snapshots[loadPointer].settings.snapshotData.isMasked == null || this.snapshots[loadPointer].settings.snapshotData.isMasked.Length != this.snapshots[loadPointer].settings.particleCount)
					{
						this.snapshots[loadPointer].settings.snapshotData.isMasked = new bool[this.snapshots[loadPointer].settings.particleCount];
						this.snapshots[loadPointer].settings.snapshotData.maskAlpha = new float[this.snapshots[loadPointer].settings.particleCount];
					}
					this.snapshots[loadPointer].settings.applyParticleMask = true;
					this.snapshots[loadPointer].settings.particleMask = mask;
					this.snapshots[loadPointer].settings.RefreshMaskSorting();
					this.snapshots[loadPointer].settings.snapshotData.maskSorting = (int[])this.snapshots[loadPointer].settings.playgroundCache.maskSorting.Clone();
					for (int i = 0; i < this.snapshots[loadPointer].settings.particleCount; i++)
					{
						int maskedP = this.snapshots[loadPointer].settings.snapshotData.maskSorting[i];
						this.snapshots[loadPointer].settings.snapshotData.isMasked[maskedP] = (i < mask);
						this.snapshots[loadPointer].settings.snapshotData.maskAlpha[maskedP] = ((i >= mask) ? 1f : 0f);
					}
				}
				base.StartCoroutine(this.LoadTransition(loadPointer));
				while (this.inTransition)
				{
					yield return null;
				}
			}
			if (this.isLoading || this.inTransition || this.abortTransition)
			{
				yield break;
			}
			this.isLoading = true;
			int prevParticleCount = this.particleCount;
			if (prevParticleCount != this.snapshots[loadPointer].settings.particleCount)
			{
				PlaygroundParticlesC.SetParticleCount(this.thisInstance, this.snapshots[loadPointer].settings.particleCount);
				while (this.isSettingParticleCount)
				{
					yield return null;
				}
			}
			this.snapshots[loadPointer].Load(this.thisInstance);
			while (this.snapshots[loadPointer].IsLoading())
			{
				yield return null;
			}
			this.lastTimeUpdated = PlaygroundC.globalTime;
			this.localTime = PlaygroundC.globalTime;
			this.cameFromNonCalculatedFrame = false;
			this.cameFromNonEmissionFrame = false;
			if (this.snapshots[loadPointer].loadMode != 1)
			{
				if (this.loadFromStart && this.isYieldRefreshing)
				{
					yield return null;
				}
				float tos = (this.snapshots[loadPointer].settings.timeOfSnapshot > 0f) ? this.snapshots[loadPointer].settings.timeOfSnapshot : this.snapshots[loadPointer].time;
				this.localTime = tos;
				for (int p = 0; p < this.particleCount; p++)
				{
					this.playgroundCache.birth[p] = tos + (this.playgroundCache.birth[p] - tos);
					this.playgroundCache.death[p] = tos + (this.playgroundCache.death[p] - tos);
					this.playgroundCache.size[p] = this.snapshots[loadPointer].settings.snapshotData.size[p];
					this.particleCache[p].startSize = this.playgroundCache.size[p];
				}
				this.lifetime = this.snapshots[loadPointer].settings.lifetime;
				this.previousLifetimeValueMethod = this.lifetimeValueMethod;
				this.previousLifetime = this.lifetime;
				this.previousLifetimeMin = this.lifetimeMin;
				this.previousLifetimeEmission = this.lifetimeEmission;
				this.previousNearestNeighborOrigin = this.nearestNeighborOrigin;
				this.previousNearestNeighborOriginMethod = this.nearestNeighborOriginMethod;
				this.previousNearestNeighborOriginVector3 = this.nearestNeighborOriginVector3;
				this.previousNearestNeighborOriginTransform = this.nearestNeighborOriginTransform;
				this.previousSorting = this.sorting;
				this.localDeltaTime = 0.001f;
				this.t = this.localDeltaTime;
			}
			else if (prevParticleCount != this.particleCount)
			{
				PlaygroundParticlesC.SetLifetime(this.thisInstance, this.sorting, this.lifetime);
				yield return null;
				while (this.isSettingLifetime)
				{
					yield return null;
				}
			}
			this.hasActiveParticles = true;
			this.threadHadNoActiveParticles = false;
			this.lastTimeUpdated = PlaygroundC.globalTime;
			this.cameFromNonCalculatedFrame = false;
			this.cameFromNonEmissionFrame = false;
			this.loopExceeded = false;
			this.loopExceededOnParticle = -1;
			this.isLoading = false;
			this.isDoneThread = true;
			this.transitionAvailable = true;
			yield break;
		}

		// Token: 0x06000969 RID: 2409 RVA: 0x000458F8 File Offset: 0x00043AF8
		public virtual IEnumerator LoadTransition(int loadPointer)
		{
			if (this.inTransition)
			{
				this.abortTransition = true;
				yield return null;
			}
			this.abortTransition = false;
			this.inTransition = true;
			float transitionStartTime = PlaygroundC.globalTime;
			float loadParticleLifetime = this.snapshots[loadPointer].settings.lifetime;
			int loadParticleCount = this.snapshots[loadPointer].settings.particleCount;
			bool liveParticles = this.snapshots[loadPointer].loadMode != 1;
			bool firstFrameDone = false;
			int currentParticleCount = this.particleCount;
			int transitionParticleCount = currentParticleCount;
			float initPosY = PlaygroundC.initialTargetPosition.y;
			PlaygroundCache loadSnapshotData = this.snapshots[loadPointer].settings.snapshotData;
			Color transparent = new Color(1f, 1f, 1f, 0f);
			INDIVIDUALTRANSITIONTYPEC thisSnapshotTransition = this.snapshots[loadPointer].transitionType;
			if (thisSnapshotTransition == INDIVIDUALTRANSITIONTYPEC.Inherit)
			{
				thisSnapshotTransition = (INDIVIDUALTRANSITIONTYPEC)(this.loadTransitionType + 1);
			}
			Vector3[] transitionPosition = (Vector3[])this.playgroundCache.position.Clone();
			Color32[] transitionColor = (Color32[])this.playgroundCache.color.Clone();
			float[] transitionSize = (float[])this.playgroundCache.size.Clone();
			float[] transitionRotation = (float[])this.playgroundCache.rotation.Clone();
			if (loadParticleCount > this.particleCount)
			{
				bool isResizing = true;
				PlaygroundC.RunAsync(delegate()
				{
					Array.Resize<Vector3>(ref transitionPosition, loadParticleCount);
					Array.Resize<Color32>(ref transitionColor, loadParticleCount);
					Array.Resize<float>(ref transitionSize, loadParticleCount);
					Array.Resize<float>(ref transitionRotation, loadParticleCount);
					Array.Resize<float>(ref transitionRotation, loadParticleCount);
					Array.Resize<Vector3>(ref this.playgroundCache.position, loadParticleCount);
					Array.Resize<Color32>(ref this.playgroundCache.color, loadParticleCount);
					Array.Resize<float>(ref this.playgroundCache.size, loadParticleCount);
					Array.Resize<float>(ref this.playgroundCache.rotation, loadParticleCount);
					for (int i = this.particleCount; i < loadParticleCount; i++)
					{
						transitionPosition[i] = transitionPosition[i % this.particleCount];
						transitionColor[i].a = 0;
					}
					isResizing = false;
				});
				while (isResizing)
				{
					yield return null;
				}
				this.particleCache = new ParticleSystem.Particle[loadParticleCount];
				this.shurikenParticleSystem.Emit(loadParticleCount);
				this.shurikenParticleSystem.GetParticles(this.particleCache);
				transitionParticleCount = loadParticleCount;
			}
			if (loadSnapshotData.lifetimeSubtraction == null || loadSnapshotData.lifetimeSubtraction.Length != loadParticleCount)
			{
				loadSnapshotData.lifetimeSubtraction = new float[loadParticleCount];
			}
			if (loadSnapshotData.isNonBirthed == null || loadSnapshotData.isNonBirthed.Length != loadParticleCount)
			{
				loadSnapshotData.isNonBirthed = new bool[loadParticleCount];
			}
			if (loadSnapshotData.isMasked == null || loadSnapshotData.isMasked.Length != loadParticleCount)
			{
				loadSnapshotData.isMasked = new bool[loadParticleCount];
			}
			for (int p = 0; p < loadParticleCount; p++)
			{
				if (loadSnapshotData.position[p].y == initPosY || loadSnapshotData.life[p] >= loadParticleLifetime - loadSnapshotData.lifetimeSubtraction[p])
				{
					loadSnapshotData.position[p] = loadSnapshotData.targetPosition[p];
					transitionColor[p].a = 0;
				}
				if (transitionPosition[p].y == initPosY || this.playgroundCache.life[p % this.particleCount] >= this.lifetime - this.playgroundCache.lifetimeSubtraction[p % this.particleCount])
				{
					transitionPosition[p] = loadSnapshotData.targetPosition[p];
					transitionColor[p].a = 0;
				}
			}
			while (PlaygroundC.globalTime < transitionStartTime + (this.loadTransitionTime * this.snapshots[loadPointer].transitionMultiplier - 0.001f) && this.inTransition && !this.abortTransition && this.loadTransition && this.loadTransitionTime * this.snapshots[loadPointer].transitionMultiplier > 0f && currentParticleCount == this.particleCount)
			{
				float currentTime = PlaygroundC.globalTime;
				PlaygroundC.RunAsync(delegate()
				{
					float num = this.TransitionType(thisSnapshotTransition, (currentTime - transitionStartTime) / (this.loadTransitionTime * this.snapshots[loadPointer].transitionMultiplier));
					for (int i = 0; i < transitionParticleCount; i++)
					{
						if (!loadSnapshotData.isNonBirthed[i % loadParticleCount])
						{
							this.playgroundCache.position[i] = Vector3.Lerp(transitionPosition[i], (!liveParticles) ? loadSnapshotData.targetPosition[i % loadParticleCount] : loadSnapshotData.position[i % loadParticleCount], num);
							if (!this.syncPositionsOnMainThread)
							{
								this.particleCache[i].position = this.playgroundCache.position[i];
							}
							if (!loadSnapshotData.isMasked[i % loadParticleCount])
							{
								this.playgroundCache.color[i] = Color32.Lerp(transitionColor[i], loadSnapshotData.color[i % loadParticleCount], num);
							}
							else if (this.playgroundCache.isMasked[i])
							{
								this.playgroundCache.color[i] = transparent;
							}
							else
							{
								this.playgroundCache.color[i] = Color32.Lerp(transitionColor[i], transparent, num);
							}
							if (loadParticleCount < this.particleCount && i >= loadParticleCount)
							{
								this.playgroundCache.color[i].a = (byte)Mathf.Lerp((float)this.playgroundCache.color[i].a, 0f, num);
							}
							this.SetParticleColorInternal(i, this.playgroundCache.color[i]);
							this.playgroundCache.size[i] = Mathf.Lerp(transitionSize[i], loadSnapshotData.size[i % loadParticleCount], num);
							this.particleCache[i].startSize = this.playgroundCache.size[i];
							this.playgroundCache.rotation[i] = Mathf.Lerp(transitionRotation[i], loadSnapshotData.rotation[i % loadParticleCount], num);
							this.particleCache[i].rotation = this.playgroundCache.rotation[i];
						}
						else
						{
							this.playgroundCache.color[i].a = (byte)Mathf.Lerp((float)this.playgroundCache.color[i].a, 0f, num);
							this.SetParticleColorInternal(i, this.playgroundCache.color[i]);
						}
					}
				});
				yield return null;
				if (firstFrameDone && currentParticleCount == this.particleCount)
				{
					if (this.syncPositionsOnMainThread)
					{
						for (int p2 = 0; p2 < transitionParticleCount; p2++)
						{
							this.particleCache[p2].position = this.playgroundCache.position[p2];
						}
					}
					this.shurikenParticleSystem.SetParticles(this.particleCache, this.particleCache.Length);
				}
				firstFrameDone = true;
			}
			if (loadParticleCount != this.particleCount && this.abortTransition)
			{
				this.particleCache = new ParticleSystem.Particle[this.particleCount];
				this.shurikenParticleSystem.Emit(this.particleCount);
				this.shurikenParticleSystem.GetParticles(this.particleCache);
				this.shurikenParticleSystem.SetParticles(this.particleCache, this.particleCache.Length);
				Array.Resize<Vector3>(ref this.playgroundCache.position, this.particleCount);
				Array.Resize<Color32>(ref this.playgroundCache.color, this.particleCount);
				Array.Resize<float>(ref this.playgroundCache.size, this.particleCount);
				Array.Resize<float>(ref this.playgroundCache.rotation, this.particleCount);
			}
			this.lastTimeUpdated = PlaygroundC.globalTime;
			this.cameFromNonCalculatedFrame = false;
			this.cameFromNonEmissionFrame = false;
			if (!this.abortTransition)
			{
				this.inTransition = false;
			}
			yield break;
		}

		// Token: 0x0600096A RID: 2410 RVA: 0x00045924 File Offset: 0x00043B24
		public virtual float TransitionType(INDIVIDUALTRANSITIONTYPEC thisTransitionType, float t)
		{
			if (thisTransitionType == INDIVIDUALTRANSITIONTYPEC.Linear)
			{
				return t;
			}
			if (thisTransitionType == INDIVIDUALTRANSITIONTYPEC.EaseIn)
			{
				return Mathf.Lerp(0f, 1f, 1f - Mathf.Cos(t * 3.14159274f * 0.5f));
			}
			if (thisTransitionType == INDIVIDUALTRANSITIONTYPEC.EaseOut)
			{
				return Mathf.Lerp(0f, 1f, Mathf.Sin(t * 3.14159274f * 0.5f));
			}
			return t;
		}

		// Token: 0x0600096B RID: 2411 RVA: 0x00045994 File Offset: 0x00043B94
		public virtual void CheckReferences()
		{
			if (PlaygroundC.reference == null)
			{
				PlaygroundC.reference = UnityEngine.Object.FindObjectOfType<PlaygroundC>();
			}
			if (PlaygroundC.reference == null)
			{
				PlaygroundC.reference = PlaygroundC.ResourceInstantiate("Playground Manager").GetComponent<PlaygroundC>();
			}
			if (this.playgroundCache == null)
			{
				this.playgroundCache = new PlaygroundCache();
			}
			if (this.thisInstance == null)
			{
				this.thisInstance = this;
			}
			if (this.particleSystemGameObject == null)
			{
				this.particleSystemGameObject = base.gameObject;
				this.particleSystemTransform = base.transform;
				this.particleSystemRenderer = base.GetComponent<Renderer>();
				this.shurikenParticleSystem = this.particleSystemGameObject.GetComponent<ParticleSystem>();
				this.particleSystemRenderer2 = (base.gameObject.GetComponent<ParticleSystem>().GetComponent<Renderer>() as ParticleSystemRenderer);
			}
		}

		// Token: 0x0600096C RID: 2412 RVA: 0x00045A70 File Offset: 0x00043C70
		public virtual IEnumerator YieldedRefresh()
		{
			if (this.isSnapshot)
			{
				yield break;
			}
			if (this.isYieldRefreshing)
			{
				yield break;
			}
			bool okToLoadFromStart = true;
			if (this.isSettingParticleCount || this.isSettingLifetime)
			{
				okToLoadFromStart = false;
			}
			while (!PlaygroundC.IsReady())
			{
				yield return null;
			}
			while (this.isSettingParticleCount)
			{
				yield return null;
			}
			while (this.isSettingLifetime)
			{
				yield return null;
			}
			if (!this.prewarm && (this.sorting == SORTINGC.NearestNeighbor || this.sorting == SORTINGC.NearestNeighborReversed))
			{
				this.shurikenParticleSystem.Clear();
				if (this.source == SOURCEC.SkinnedWorldObject)
				{
					yield return null;
				}
				PlaygroundParticlesC.SetLifetime(this.thisInstance, SORTINGC.Burst, this.lifetime);
				while (this.isSettingLifetime)
				{
					yield return null;
				}
				this.isYieldRefreshing = false;
				base.StartCoroutine(this.Prewarm((!this.loop) ? 0f : this.prewarmTime, 0));
				yield return null;
				while (this.isPrewarming)
				{
					yield return null;
				}
				PlaygroundParticlesC.SetParticleTimeNow(this.thisInstance);
				this.initialized = true;
				yield break;
			}
			while (this.isSettingParticleCount || this.isSettingLifetime)
			{
				yield return null;
			}
			this.isYieldRefreshing = true;
			if (okToLoadFromStart && this.loadFromStart && this.snapshots.Count > 0)
			{
				PlaygroundParticlesC.SetLifetime(this.thisInstance, this.sorting, this.lifetime);
				this.Load(this.loadFrom);
				yield return null;
				this.isYieldRefreshing = false;
				this.initialized = true;
				yield break;
			}
			PlaygroundParticlesC.SetLifetime(this.thisInstance, this.sorting, this.lifetime);
			if (this.multithreadedStartup)
			{
				while (this.isSettingLifetime)
				{
					yield return null;
				}
				yield return null;
			}
			this.transitionAvailable = true;
			this.hasActiveParticles = true;
			this.threadHadNoActiveParticles = false;
			this.isYieldRefreshing = false;
			this.emissionStopped = 0f;
			if (this.prewarm)
			{
				this.prewarmCycles = Mathf.Clamp(this.prewarmCycles, 0, 1000);
				base.StartCoroutine(this.Prewarm(this.prewarmTime, this.prewarmCycles));
			}
			while (this.isPrewarming)
			{
				yield return null;
			}
			this.initialized = true;
			yield break;
		}

		// Token: 0x0600096D RID: 2413 RVA: 0x00045A8C File Offset: 0x00043C8C
		public virtual IEnumerator Prewarm(float time, int resolution)
		{
			if (this.isPrewarming || this.isLoading)
			{
				yield break;
			}
			if (this.source == SOURCEC.SkinnedWorldObject || this.HasTurbulence())
			{
				yield return null;
			}
			this.isPrewarming = true;
			while (this.isSettingParticleCount || this.isSettingLifetime)
			{
				yield return null;
			}
			resolution = Mathf.Clamp(resolution, 0, 1000);
			float storedLocalTime = 0f;
			bool isPrewarmingAsync = false;
			this.isReadyForThreadedCalculations = this.PrepareThreadedCalculations();
			if (this.isReadyForThreadedCalculations)
			{
				this.localTime = PlaygroundC.globalTime;
				this.lastTimeUpdated = PlaygroundC.globalTime;
				if (this.sorting == SORTINGC.NearestNeighbor || this.sorting == SORTINGC.NearestNeighborReversed)
				{
					if (this.nearestNeighborOriginMethod == NEARESTNEIGHBORORIGINMETHOD.Transform && this.nearestNeighborOriginTransform != null)
					{
						this.nearestNeighborOriginTransformPosition = ((this.shurikenParticleSystem.simulationSpace != ParticleSystemSimulationSpace.World) ? this.particleSystemTransform.InverseTransformPoint(this.nearestNeighborOriginTransform.position) : this.nearestNeighborOriginTransform.position);
					}
					storedLocalTime = this.localTime;
					PlaygroundParticlesC.SetLifetime(this.thisInstance, SORTINGC.Burst, this.lifetime);
					while (this.isSettingLifetime)
					{
						yield return null;
					}
					this.localTime = storedLocalTime;
					for (int p = 0; p < this.particleCount; p++)
					{
						this.SetSourcePosition(p);
					}
					storedLocalTime = this.localTime;
					PlaygroundParticlesC.SetLifetime(this.thisInstance, this.sorting, this.lifetime);
					while (this.isSettingLifetime)
					{
						yield return null;
					}
					this.localTime = storedLocalTime;
					for (int p2 = 0; p2 < this.particleCount; p2++)
					{
						this.SetSourcePosition(p2);
					}
				}
				while (this.isSettingLifetime)
				{
					yield return null;
				}
				if (resolution > 0)
				{
					isPrewarmingAsync = true;
					PlaygroundC.RunAsync(delegate()
					{
						int currentCycles = 0;
						while (currentCycles <= resolution)
						{
							this.PrewarmStepper(time, resolution);
							currentCycles++;
						}
						if (this.syncPositionsOnMainThread && this.calculateDeltaMovement)
						{
							for (int i = 0; i < this.particleCount; i++)
							{
								this.playgroundCache.previousTargetPosition[i] = this.playgroundCache.targetPosition[i];
							}
						}
						isPrewarmingAsync = false;
					});
				}
			}
			while (isPrewarmingAsync)
			{
				yield return null;
			}
			this.isPrewarming = false;
			yield break;
		}

		// Token: 0x0600096E RID: 2414 RVA: 0x00045AC4 File Offset: 0x00043CC4
		public virtual void PrewarmStepper(float time, int resolution)
		{
			this.localDeltaTime = this.lifetime * time / ((float)resolution * 1f);
			this.t = this.localDeltaTime;
			this.localTime += this.t;
			PlaygroundParticlesC.ThreadedCalculations(this.thisInstance);
			if (this.HasTurbulence() && PlaygroundC.reference.turbulenceThreadMethod == ThreadMethodComponent.OneForAll)
			{
				for (int i = 0; i < this.particleCount; i++)
				{
					PlaygroundParticlesC.Turbulence(this.thisInstance, this.turbulenceSimplex, i, this.t, this.turbulenceType, this.turbulenceTimeScale, this.turbulenceScale, this.turbulenceStrength, this.turbulenceApplyLifetimeStrength, this.turbulenceLifetimeStrength);
				}
			}
		}

		// Token: 0x0600096F RID: 2415 RVA: 0x00045B80 File Offset: 0x00043D80
		public virtual void OnEnable()
		{
			if (this.isSnapshot || this.isLoading)
			{
				return;
			}
			this.thisInstance = this;
			this.thisLayer = this.particleSystemGameObject.layer;
			this.initialized = false;
			this.isYieldRefreshing = false;
			this.isSettingParticleCount = false;
			this.isSettingLifetime = false;
			this.hasActiveParticles = true;
			this.threadHadNoActiveParticles = false;
			this.isDoneThread = true;
			this.calculate = true;
			this.lastTimeUpdated = PlaygroundC.globalTime;
			this.localTime = this.lastTimeUpdated;
			this.emissionStopped = 0f;
			this.queueEmissionHalt = false;
			this.hasEmitted = false;
			this.RefreshSystemRandom();
			this.shurikenParticleSystem.startSize = 0f;
			if (this.shurikenParticleSystem.isPaused || this.shurikenParticleSystem.isStopped)
			{
				this.shurikenParticleSystem.Play();
			}
			this.previousLifetimeValueMethod = this.lifetimeValueMethod;
			this.previousLifetime = this.lifetime;
			this.previousLifetimeMin = this.lifetimeMin;
			this.previousEmission = this.emit;
			this.previousLoop = this.loop;
			this.previousNearestNeighborOrigin = this.nearestNeighborOrigin;
			this.previousNearestNeighborOriginMethod = this.nearestNeighborOriginMethod;
			this.previousNearestNeighborOriginVector3 = this.nearestNeighborOriginVector3;
			this.previousNearestNeighborOriginTransform = this.nearestNeighborOriginTransform;
			this.previousSorting = this.sorting;
			this.previousParticleCount = this.particleCount;
			this.previousLifetimeEmission = this.lifetimeEmission;
			this.prevSource = this.source;
			this.loopExceeded = false;
			this.loopExceededOnParticle = -1;
			this.stRot = Quaternion.identity;
			this.stDir = default(Vector3);
			if (this.particleCache == null)
			{
				PlaygroundParticlesC.SetParticleCount(this.thisInstance, this.particleCount);
			}
			else
			{
				PlaygroundParticlesC.SetInitialTargetPosition(this.thisInstance, PlaygroundC.initialTargetPosition, true);
				this.hasCollisionCache = false;
				this.collisionCache = null;
				base.StartCoroutine(this.YieldedRefresh());
			}
		}

		// Token: 0x06000970 RID: 2416 RVA: 0x00045D78 File Offset: 0x00043F78
		public virtual void Start()
		{
			if (this.isSnapshot || !base.gameObject.activeInHierarchy || !base.gameObject.activeSelf)
			{
				return;
			}
			this.CheckReferences();
			if (this.thisInstance.enabled)
			{
				if (this.source == SOURCEC.State)
				{
					for (int i = 0; i < this.states.Count; i++)
					{
						this.states[i].Initialize();
					}
				}
				if (this.worldObject != null && this.worldObject.transform != null && this.worldObject.gameObject != null && this.worldObject.gameObject.activeInHierarchy)
				{
					this.worldObject.Initialize();
				}
				if (this.skinnedWorldObject != null && this.skinnedWorldObject.transform != null && this.skinnedWorldObject.gameObject != null && this.skinnedWorldObject.gameObject.activeInHierarchy)
				{
					this.skinnedWorldObject.Initialize();
				}
				if (this.projection != null && this.projection.projectionTexture != null)
				{
					this.projection.Initialize();
				}
				if (this.manipulators.Count > 0)
				{
					for (int j = 0; j < this.manipulators.Count; j++)
					{
						this.manipulators[j].Update();
					}
				}
			}
			if (PlaygroundC.reference != null)
			{
				if (this.isSnapshot)
				{
					return;
				}
				if (!PlaygroundC.reference.particleSystems.Contains(this.thisInstance))
				{
					PlaygroundC.reference.particleSystems.Add(this.thisInstance);
				}
				if (this.particleSystemTransform.parent == null && PlaygroundC.reference.autoGroup)
				{
					this.particleSystemTransform.parent = PlaygroundC.referenceTransform;
				}
			}
			if (this.splines != null && this.splines.Count > 0)
			{
				for (int k = 0; k < this.splines.Count; k++)
				{
					if (this.splines[k] != null)
					{
						this.splines[k].AddUser(this.particleSystemTransform);
					}
				}
			}
			this.eventControlledBy = new List<PlaygroundParticlesC>();
			base.StartCoroutine(this.Boot());
		}

		// Token: 0x06000971 RID: 2417 RVA: 0x00046018 File Offset: 0x00044218
		public virtual IEnumerator Boot()
		{
			if (this.particleSystemGameObject.activeInHierarchy && this.particleSystemGameObject.activeSelf && !this.isLoading && base.enabled)
			{
				while (PlaygroundC.reference == null)
				{
					yield return null;
				}
				if (PlaygroundC.reference.HasEnabledGlobalManipulators())
				{
					for (int i = 0; i < PlaygroundC.reference.manipulators.Count; i++)
					{
						if (PlaygroundC.reference.manipulators[i].trackParticles && (PlaygroundC.reference.manipulators[i].affects.value & 1 << this.GetLayer()) != 0 && PlaygroundC.reference.threadMethod != ThreadMethod.NoThreads)
						{
							this.threadMethod = ThreadMethodLocal.OneForAll;
						}
					}
				}
				this.localTime = PlaygroundC.globalTime;
				this.lastTimeUpdated = this.localTime;
				for (int j = 0; j < PlaygroundC.reference.particleSystems.Count; j++)
				{
					if (PlaygroundC.reference.particleSystems[j].particleSystemId == this.particleSystemId && PlaygroundC.reference.particleSystems[j] != this)
					{
						this.particleSystemId = PlaygroundC.reference.particleSystems.Count - 1;
						break;
					}
				}
				if (!this.isYieldRefreshing)
				{
					base.StartCoroutine(this.YieldedRefresh());
				}
			}
			yield break;
		}

		// Token: 0x06000972 RID: 2418 RVA: 0x00046034 File Offset: 0x00044234
		public virtual void OnDestroy()
		{
			for (int i = 0; i < this.events.Count; i++)
			{
				if (this.events[i].target != null)
				{
					this.events[i].target.eventControlledBy.Remove(this.thisInstance);
				}
			}
			if (this.splines.Count > 0)
			{
				for (int j = 0; j < this.splines.Count; j++)
				{
					if (this.splines[j] != null)
					{
						this.splines[j].RemoveUser(this.particleSystemTransform);
					}
				}
			}
			if (PlaygroundC.reference)
			{
				PlaygroundC.reference.particleSystems.Remove(this.thisInstance);
			}
		}

		// Token: 0x06000973 RID: 2419 RVA: 0x0004611C File Offset: 0x0004431C
		public virtual void OnDisable()
		{
			this.initialized = false;
		}

		// Token: 0x040009A8 RID: 2472
		[HideInInspector]
		public SOURCEC source;

		// Token: 0x040009A9 RID: 2473
		[HideInInspector]
		public int activeState;

		// Token: 0x040009AA RID: 2474
		[HideInInspector]
		public bool emit = true;

		// Token: 0x040009AB RID: 2475
		[HideInInspector]
		public bool loop = true;

		// Token: 0x040009AC RID: 2476
		[HideInInspector]
		public bool clearParticlesOnEmissionStop;

		// Token: 0x040009AD RID: 2477
		[HideInInspector]
		public bool disableOnDone;

		// Token: 0x040009AE RID: 2478
		[HideInInspector]
		public ONDONE disableOnDoneRoutine;

		// Token: 0x040009AF RID: 2479
		[HideInInspector]
		public int updateRate = 1;

		// Token: 0x040009B0 RID: 2480
		[HideInInspector]
		public bool calculate = true;

		// Token: 0x040009B1 RID: 2481
		[HideInInspector]
		public bool calculateDeltaMovement = true;

		// Token: 0x040009B2 RID: 2482
		[HideInInspector]
		public float deltaMovementStrength = 10f;

		// Token: 0x040009B3 RID: 2483
		[HideInInspector]
		public float minDeltaMovementStrength;

		// Token: 0x040009B4 RID: 2484
		[HideInInspector]
		public VALUEMETHOD deltaMovementStrengthValueMethod;

		// Token: 0x040009B5 RID: 2485
		[HideInInspector]
		public bool worldObjectUpdateVertices;

		// Token: 0x040009B6 RID: 2486
		[HideInInspector]
		public bool worldObjectUpdateNormals;

		// Token: 0x040009B7 RID: 2487
		[HideInInspector]
		public NEARESTNEIGHBORORIGINMETHOD nearestNeighborOriginMethod;

		// Token: 0x040009B8 RID: 2488
		[HideInInspector]
		public int nearestNeighborOrigin;

		// Token: 0x040009B9 RID: 2489
		[HideInInspector]
		public Vector3 nearestNeighborOriginVector3;

		// Token: 0x040009BA RID: 2490
		[HideInInspector]
		public Transform nearestNeighborOriginTransform;

		// Token: 0x040009BB RID: 2491
		[HideInInspector]
		public int particleCount;

		// Token: 0x040009BC RID: 2492
		[HideInInspector]
		public float emissionRate = 1f;

		// Token: 0x040009BD RID: 2493
		[HideInInspector]
		public OVERFLOWMODEC overflowMode;

		// Token: 0x040009BE RID: 2494
		[HideInInspector]
		public Vector3 overflowOffset;

		// Token: 0x040009BF RID: 2495
		[HideInInspector]
		public bool applySourceScatter;

		// Token: 0x040009C0 RID: 2496
		[HideInInspector]
		public Vector3 sourceScatterMin;

		// Token: 0x040009C1 RID: 2497
		[HideInInspector]
		public Vector3 sourceScatterMax;

		// Token: 0x040009C2 RID: 2498
		[HideInInspector]
		public Vector3 scatterScale = new Vector3(1f, 1f, 1f);

		// Token: 0x040009C3 RID: 2499
		[HideInInspector]
		public MINMAXVECTOR3METHOD sourceScatterMethod;

		// Token: 0x040009C4 RID: 2500
		[HideInInspector]
		public SORTINGC sorting;

		// Token: 0x040009C5 RID: 2501
		[HideInInspector]
		public AnimationCurve lifetimeSorting;

		// Token: 0x040009C6 RID: 2502
		[HideInInspector]
		public float sizeMin = 1f;

		// Token: 0x040009C7 RID: 2503
		[HideInInspector]
		public float sizeMax = 1f;

		// Token: 0x040009C8 RID: 2504
		[HideInInspector]
		public float scale = 1f;

		// Token: 0x040009C9 RID: 2505
		[HideInInspector]
		public float initialRotationMin;

		// Token: 0x040009CA RID: 2506
		[HideInInspector]
		public float initialRotationMax;

		// Token: 0x040009CB RID: 2507
		[HideInInspector]
		public float rotationSpeedMin;

		// Token: 0x040009CC RID: 2508
		[HideInInspector]
		public float rotationSpeedMax;

		// Token: 0x040009CD RID: 2509
		[HideInInspector]
		public bool rotateTowardsDirection;

		// Token: 0x040009CE RID: 2510
		[HideInInspector]
		public Vector3 rotationNormal = -Vector3.forward;

		// Token: 0x040009CF RID: 2511
		[HideInInspector]
		public VALUEMETHOD lifetimeValueMethod;

		// Token: 0x040009D0 RID: 2512
		[HideInInspector]
		public float lifetime;

		// Token: 0x040009D1 RID: 2513
		[HideInInspector]
		public float lifetimeMin;

		// Token: 0x040009D2 RID: 2514
		[HideInInspector]
		public float lifetimeOffset;

		// Token: 0x040009D3 RID: 2515
		[HideInInspector]
		public float lifetimeEmission = 1f;

		// Token: 0x040009D4 RID: 2516
		[HideInInspector]
		public float minShurikenLifetime = 0.08f;

		// Token: 0x040009D5 RID: 2517
		[HideInInspector]
		public bool applyLifetimeSize = true;

		// Token: 0x040009D6 RID: 2518
		[HideInInspector]
		public AnimationCurve lifetimeSize;

		// Token: 0x040009D7 RID: 2519
		[HideInInspector]
		public bool applyParticleArraySize;

		// Token: 0x040009D8 RID: 2520
		[HideInInspector]
		public AnimationCurve particleArraySize;

		// Token: 0x040009D9 RID: 2521
		[HideInInspector]
		public bool transitionBackToSource;

		// Token: 0x040009DA RID: 2522
		[HideInInspector]
		public AnimationCurve transitionBackToSourceAmount;

		// Token: 0x040009DB RID: 2523
		[HideInInspector]
		public bool onlySourcePositioning;

		// Token: 0x040009DC RID: 2524
		[HideInInspector]
		public bool onlyLifetimePositioning;

		// Token: 0x040009DD RID: 2525
		[HideInInspector]
		public Vector3AnimationCurveC lifetimePositioning;

		// Token: 0x040009DE RID: 2526
		[HideInInspector]
		public bool applyLifetimePositioningTimeScale;

		// Token: 0x040009DF RID: 2527
		[HideInInspector]
		public bool applyLifetimePositioningPositionScale;

		// Token: 0x040009E0 RID: 2528
		[HideInInspector]
		public AnimationCurve lifetimePositioningTimeScale;

		// Token: 0x040009E1 RID: 2529
		[HideInInspector]
		public AnimationCurve lifetimePositioningPositionScale;

		// Token: 0x040009E2 RID: 2530
		[HideInInspector]
		public float lifetimePositioningScale = 1f;

		// Token: 0x040009E3 RID: 2531
		[HideInInspector]
		public bool lifetimePositioningUsesSourceDirection;

		// Token: 0x040009E4 RID: 2532
		[HideInInspector]
		public bool applyLifetimeVelocity;

		// Token: 0x040009E5 RID: 2533
		[HideInInspector]
		public Vector3AnimationCurveC lifetimeVelocity;

		// Token: 0x040009E6 RID: 2534
		[HideInInspector]
		public float lifetimeVelocityScale = 1f;

		// Token: 0x040009E7 RID: 2535
		[HideInInspector]
		public bool applyInitialVelocity;

		// Token: 0x040009E8 RID: 2536
		[HideInInspector]
		public Vector3 initialVelocityMin;

		// Token: 0x040009E9 RID: 2537
		[HideInInspector]
		public Vector3 initialVelocityMax;

		// Token: 0x040009EA RID: 2538
		[HideInInspector]
		public MINMAXVECTOR3METHOD initialVelocityMethod;

		// Token: 0x040009EB RID: 2539
		[HideInInspector]
		public bool applyInitialLocalVelocity;

		// Token: 0x040009EC RID: 2540
		[HideInInspector]
		public Vector3 initialLocalVelocityMin;

		// Token: 0x040009ED RID: 2541
		[HideInInspector]
		public Vector3 initialLocalVelocityMax;

		// Token: 0x040009EE RID: 2542
		[HideInInspector]
		public MINMAXVECTOR3METHOD initialLocalVelocityMethod;

		// Token: 0x040009EF RID: 2543
		[HideInInspector]
		public bool applyInitialVelocityShape;

		// Token: 0x040009F0 RID: 2544
		[HideInInspector]
		public Vector3AnimationCurveC initialVelocityShape;

		// Token: 0x040009F1 RID: 2545
		[HideInInspector]
		public float initialVelocityShapeScale = 1f;

		// Token: 0x040009F2 RID: 2546
		[HideInInspector]
		public bool applyVelocityBending;

		// Token: 0x040009F3 RID: 2547
		[HideInInspector]
		public Vector3 velocityBending;

		// Token: 0x040009F4 RID: 2548
		[HideInInspector]
		public VELOCITYBENDINGTYPEC velocityBendingType;

		// Token: 0x040009F5 RID: 2549
		[HideInInspector]
		public Vector3 gravity;

		// Token: 0x040009F6 RID: 2550
		[HideInInspector]
		public float maxVelocity = 100f;

		// Token: 0x040009F7 RID: 2551
		[HideInInspector]
		public PlaygroundAxisConstraintsC axisConstraints = new PlaygroundAxisConstraintsC();

		// Token: 0x040009F8 RID: 2552
		[HideInInspector]
		public float damping;

		// Token: 0x040009F9 RID: 2553
		[HideInInspector]
		public float velocityScale = 1f;

		// Token: 0x040009FA RID: 2554
		[HideInInspector]
		public Gradient lifetimeColor;

		// Token: 0x040009FB RID: 2555
		[HideInInspector]
		public List<PlaygroundGradientC> lifetimeColors = new List<PlaygroundGradientC>();

		// Token: 0x040009FC RID: 2556
		[HideInInspector]
		public COLORSOURCEC colorSource;

		// Token: 0x040009FD RID: 2557
		[HideInInspector]
		public bool sourceUsesLifetimeAlpha;

		// Token: 0x040009FE RID: 2558
		[HideInInspector]
		public COLORMETHOD colorMethod;

		// Token: 0x040009FF RID: 2559
		[HideInInspector]
		public bool arrayColorUsesAlpha;

		// Token: 0x04000A00 RID: 2560
		[HideInInspector]
		public Gradient arrayColorAlpha;

		// Token: 0x04000A01 RID: 2561
		[HideInInspector]
		public bool applyLocalSpaceMovementCompensation = true;

		// Token: 0x04000A02 RID: 2562
		[HideInInspector]
		public bool applyRandomSizeOnRebirth = true;

		// Token: 0x04000A03 RID: 2563
		[HideInInspector]
		public bool applyRandomInitialVelocityOnRebirth = true;

		// Token: 0x04000A04 RID: 2564
		[HideInInspector]
		public bool applyRandomRotationOnRebirth = true;

		// Token: 0x04000A05 RID: 2565
		[HideInInspector]
		public bool applyRandomScatterOnRebirth;

		// Token: 0x04000A06 RID: 2566
		[HideInInspector]
		public bool applyInitialColorOnRebirth;

		// Token: 0x04000A07 RID: 2567
		[HideInInspector]
		public bool applyRandomLifetimeOnRebirth = true;

		// Token: 0x04000A08 RID: 2568
		[HideInInspector]
		public bool applyDeltaOnRebirth = true;

		// Token: 0x04000A09 RID: 2569
		[HideInInspector]
		public bool calculateManipulatorOnRebirth;

		// Token: 0x04000A0A RID: 2570
		[HideInInspector]
		public bool pauseCalculationWhenInvisible;

		// Token: 0x04000A0B RID: 2571
		[HideInInspector]
		public bool calculationTriggerSizeGizmo;

		// Token: 0x04000A0C RID: 2572
		[HideInInspector]
		public Transform calculationTriggerTransform;

		// Token: 0x04000A0D RID: 2573
		[HideInInspector]
		public Vector3 calculationTriggerSize = new Vector3(1f, 1f, 1f);

		// Token: 0x04000A0E RID: 2574
		[HideInInspector]
		public Vector3 calculationTriggerOffset = default(Vector3);

		// Token: 0x04000A0F RID: 2575
		[HideInInspector]
		public bool forceVisibilityWhenOutOfFrustrum = true;

		// Token: 0x04000A10 RID: 2576
		[HideInInspector]
		public bool syncPositionsOnMainThread;

		// Token: 0x04000A11 RID: 2577
		[HideInInspector]
		public bool applyLockPosition;

		// Token: 0x04000A12 RID: 2578
		[HideInInspector]
		public bool applyLockRotation;

		// Token: 0x04000A13 RID: 2579
		[HideInInspector]
		public bool applyLockScale;

		// Token: 0x04000A14 RID: 2580
		[HideInInspector]
		public bool lockPositionIsLocal;

		// Token: 0x04000A15 RID: 2581
		[HideInInspector]
		public bool lockRotationIsLocal;

		// Token: 0x04000A16 RID: 2582
		[HideInInspector]
		public Vector3 lockPosition = Vector3.zero;

		// Token: 0x04000A17 RID: 2583
		[HideInInspector]
		public Vector3 lockRotation = Vector3.zero;

		// Token: 0x04000A18 RID: 2584
		[HideInInspector]
		public Vector3 lockScale = new Vector3(1f, 1f, 1f);

		// Token: 0x04000A19 RID: 2585
		[HideInInspector]
		public bool applyMovementCompensationLifetimeStrength;

		// Token: 0x04000A1A RID: 2586
		[HideInInspector]
		public AnimationCurve movementCompensationLifetimeStrength;

		// Token: 0x04000A1B RID: 2587
		[HideInInspector]
		public bool applyParticleMask;

		// Token: 0x04000A1C RID: 2588
		[HideInInspector]
		public int particleMask;

		// Token: 0x04000A1D RID: 2589
		[HideInInspector]
		public float particleMaskTime;

		// Token: 0x04000A1E RID: 2590
		[HideInInspector]
		public MASKSORTINGC particleMaskSorting;

		// Token: 0x04000A1F RID: 2591
		[HideInInspector]
		public float stretchSpeed = 1f;

		// Token: 0x04000A20 RID: 2592
		[HideInInspector]
		public bool applyStretchStartDirection;

		// Token: 0x04000A21 RID: 2593
		[HideInInspector]
		public Vector3 stretchStartDirection = Vector3.zero;

		// Token: 0x04000A22 RID: 2594
		[HideInInspector]
		public bool applyLifetimeStretching;

		// Token: 0x04000A23 RID: 2595
		[HideInInspector]
		public AnimationCurve stretchLifetime;

		// Token: 0x04000A24 RID: 2596
		[HideInInspector]
		public ThreadMethodLocal threadMethod;

		// Token: 0x04000A25 RID: 2597
		[HideInInspector]
		public bool multithreadedStartup = true;

		// Token: 0x04000A26 RID: 2598
		[HideInInspector]
		public int scriptedEmissionIndex;

		// Token: 0x04000A27 RID: 2599
		[HideInInspector]
		public Vector3 scriptedEmissionPosition;

		// Token: 0x04000A28 RID: 2600
		[HideInInspector]
		public Vector3 scriptedEmissionVelocity;

		// Token: 0x04000A29 RID: 2601
		[HideInInspector]
		public Color scriptedEmissionColor = Color.white;

		// Token: 0x04000A2A RID: 2602
		[HideInInspector]
		protected float scriptedLifetime;

		// Token: 0x04000A2B RID: 2603
		[HideInInspector]
		public bool collision;

		// Token: 0x04000A2C RID: 2604
		[HideInInspector]
		public bool affectRigidbodies = true;

		// Token: 0x04000A2D RID: 2605
		[HideInInspector]
		public bool inverseRigidbodyCollision;

		// Token: 0x04000A2E RID: 2606
		[HideInInspector]
		public float mass = 0.01f;

		// Token: 0x04000A2F RID: 2607
		[HideInInspector]
		public float collisionRadius = 1f;

		// Token: 0x04000A30 RID: 2608
		[HideInInspector]
		public LayerMask collisionMask;

		// Token: 0x04000A31 RID: 2609
		[HideInInspector]
		public List<Transform> collisionExclusion;

		// Token: 0x04000A32 RID: 2610
		[HideInInspector]
		public float lifetimeLoss;

		// Token: 0x04000A33 RID: 2611
		[HideInInspector]
		public float bounciness = 0.5f;

		// Token: 0x04000A34 RID: 2612
		[HideInInspector]
		public Vector3 bounceRandomMin;

		// Token: 0x04000A35 RID: 2613
		[HideInInspector]
		public Vector3 bounceRandomMax;

		// Token: 0x04000A36 RID: 2614
		[HideInInspector]
		public List<PlaygroundColliderC> colliders;

		// Token: 0x04000A37 RID: 2615
		[HideInInspector]
		public COLLISIONTYPEC collisionType;

		// Token: 0x04000A38 RID: 2616
		[HideInInspector]
		public float minCollisionDepth;

		// Token: 0x04000A39 RID: 2617
		[HideInInspector]
		public float maxCollisionDepth;

		// Token: 0x04000A3A RID: 2618
		[HideInInspector]
		public bool stickyCollisions;

		// Token: 0x04000A3B RID: 2619
		[HideInInspector]
		public float stickyCollisionsSurfaceOffset;

		// Token: 0x04000A3C RID: 2620
		[HideInInspector]
		public LayerMask stickyCollisionsMask = -1;

		// Token: 0x04000A3D RID: 2621
		[HideInInspector]
		public bool collisionPrecision;

		// Token: 0x04000A3E RID: 2622
		[HideInInspector]
		public bool forceCollisionCaching;

		// Token: 0x04000A3F RID: 2623
		[HideInInspector]
		public bool maskedParticlesBypassCollision = true;

		// Token: 0x04000A40 RID: 2624
		public List<ParticleStateC> states = new List<ParticleStateC>();

		// Token: 0x04000A41 RID: 2625
		[HideInInspector]
		public List<PlaygroundSplines.PlaygroundSpline> splines;

		// Token: 0x04000A42 RID: 2626
		[HideInInspector]
		public float splineTimeOffset;

		// Token: 0x04000A43 RID: 2627
		[HideInInspector]
		public bool treatAsOneSpline;

		// Token: 0x04000A44 RID: 2628
		protected int splineIndex;

		// Token: 0x04000A45 RID: 2629
		[HideInInspector]
		public WorldObject worldObject = new WorldObject();

		// Token: 0x04000A46 RID: 2630
		[HideInInspector]
		public SkinnedWorldObject skinnedWorldObject = new SkinnedWorldObject();

		// Token: 0x04000A47 RID: 2631
		[HideInInspector]
		public bool forceSkinnedMeshUpdateOnMainThread;

		// Token: 0x04000A48 RID: 2632
		[HideInInspector]
		public Transform sourceTransform;

		// Token: 0x04000A49 RID: 2633
		[HideInInspector]
		public List<PlaygroundTransformC> sourceTransforms;

		// Token: 0x04000A4A RID: 2634
		[HideInInspector]
		public bool treatAsOneTransform;

		// Token: 0x04000A4B RID: 2635
		protected int transformIndex;

		// Token: 0x04000A4C RID: 2636
		[HideInInspector]
		public PlaygroundParticlesC otherParticleSource;

		// Token: 0x04000A4D RID: 2637
		[HideInInspector]
		public SOURCEBIRTHMETHOD otherParticleSourceMethod;

		// Token: 0x04000A4E RID: 2638
		[HideInInspector]
		public PaintObjectC paint;

		// Token: 0x04000A4F RID: 2639
		[HideInInspector]
		public ParticleProjectionC projection;

		// Token: 0x04000A50 RID: 2640
		public List<ManipulatorObjectC> manipulators;

		// Token: 0x04000A51 RID: 2641
		[HideInInspector]
		public List<PlaygroundEventC> events;

		// Token: 0x04000A52 RID: 2642
		[NonSerialized]
		public PlaygroundCache playgroundCache = new PlaygroundCache();

		// Token: 0x04000A53 RID: 2643
		[NonSerialized]
		public ParticleSystem.Particle[] particleCache;

		// Token: 0x04000A54 RID: 2644
		[NonSerialized]
		public CollisionCache collisionCache;

		// Token: 0x04000A55 RID: 2645
		[HideInInspector]
		public List<PlaygroundSave> snapshots = new List<PlaygroundSave>();

		// Token: 0x04000A56 RID: 2646
		[HideInInspector]
		public bool loadFromStart;

		// Token: 0x04000A57 RID: 2647
		[HideInInspector]
		public int loadFrom;

		// Token: 0x04000A58 RID: 2648
		[HideInInspector]
		public bool loadTransition;

		// Token: 0x04000A59 RID: 2649
		[HideInInspector]
		public TRANSITIONTYPEC loadTransitionType;

		// Token: 0x04000A5A RID: 2650
		[HideInInspector]
		public float loadTransitionTime = 1f;

		// Token: 0x04000A5B RID: 2651
		[HideInInspector]
		public PlaygroundCache snapshotData;

		// Token: 0x04000A5C RID: 2652
		[HideInInspector]
		public float timeOfSnapshot;

		// Token: 0x04000A5D RID: 2653
		public bool isSnapshot;

		// Token: 0x04000A5E RID: 2654
		[HideInInspector]
		public ParticleSystem shurikenParticleSystem;

		// Token: 0x04000A5F RID: 2655
		[HideInInspector]
		public int particleSystemId;

		// Token: 0x04000A60 RID: 2656
		[HideInInspector]
		public GameObject particleSystemGameObject;

		// Token: 0x04000A61 RID: 2657
		[HideInInspector]
		public Transform particleSystemTransform;

		// Token: 0x04000A62 RID: 2658
		[HideInInspector]
		public Renderer particleSystemRenderer;

		// Token: 0x04000A63 RID: 2659
		[HideInInspector]
		public ParticleSystemRenderer particleSystemRenderer2;

		// Token: 0x04000A64 RID: 2660
		[HideInInspector]
		public List<PlaygroundParticlesC> eventControlledBy = new List<PlaygroundParticlesC>();

		// Token: 0x04000A65 RID: 2661
		protected SimplexNoise turbulenceSimplex;

		// Token: 0x04000A66 RID: 2662
		[HideInInspector]
		public TURBULENCETYPE turbulenceType;

		// Token: 0x04000A67 RID: 2663
		[HideInInspector]
		public float turbulenceStrength = 10f;

		// Token: 0x04000A68 RID: 2664
		[HideInInspector]
		public float turbulenceScale = 1f;

		// Token: 0x04000A69 RID: 2665
		[HideInInspector]
		public float turbulenceTimeScale = 1f;

		// Token: 0x04000A6A RID: 2666
		[HideInInspector]
		public bool turbulenceApplyLifetimeStrength;

		// Token: 0x04000A6B RID: 2667
		[HideInInspector]
		public AnimationCurve turbulenceLifetimeStrength;

		// Token: 0x04000A6C RID: 2668
		[HideInInspector]
		public bool prewarm;

		// Token: 0x04000A6D RID: 2669
		[HideInInspector]
		public float prewarmTime = 1f;

		// Token: 0x04000A6E RID: 2670
		[HideInInspector]
		public int prewarmCycles = 16;

		// Token: 0x04000A6F RID: 2671
		[HideInInspector]
		public float particleTimescale = 1f;

		// Token: 0x04000A70 RID: 2672
		protected int thisLayer;

		// Token: 0x04000A71 RID: 2673
		protected bool isPrewarming;

		// Token: 0x04000A72 RID: 2674
		protected bool inTransition;

		// Token: 0x04000A73 RID: 2675
		protected int previousParticleCount = -1;

		// Token: 0x04000A74 RID: 2676
		protected float previousEmissionRate = 1f;

		// Token: 0x04000A75 RID: 2677
		protected bool renderModeStretch;

		// Token: 0x04000A76 RID: 2678
		protected float previousSizeMin;

		// Token: 0x04000A77 RID: 2679
		protected float previousSizeMax;

		// Token: 0x04000A78 RID: 2680
		protected float previousInitialRotationMin;

		// Token: 0x04000A79 RID: 2681
		protected float previousInitialRotationMax;

		// Token: 0x04000A7A RID: 2682
		protected float previousRotationSpeedMin;

		// Token: 0x04000A7B RID: 2683
		protected float previousRotationSpeedMax;

		// Token: 0x04000A7C RID: 2684
		protected Vector3 previousVelocityMin;

		// Token: 0x04000A7D RID: 2685
		protected Vector3 previousVelocityMax;

		// Token: 0x04000A7E RID: 2686
		protected Vector3 previousLocalVelocityMin;

		// Token: 0x04000A7F RID: 2687
		protected Vector3 previousLocalVelocityMax;

		// Token: 0x04000A80 RID: 2688
		protected MINMAXVECTOR3METHOD previousLocalVelocityMethod;

		// Token: 0x04000A81 RID: 2689
		protected MINMAXVECTOR3METHOD previousVelocityMethod;

		// Token: 0x04000A82 RID: 2690
		protected SORTINGC previousSorting;

		// Token: 0x04000A83 RID: 2691
		protected int previousNearestNeighborOrigin;

		// Token: 0x04000A84 RID: 2692
		protected NEARESTNEIGHBORORIGINMETHOD previousNearestNeighborOriginMethod;

		// Token: 0x04000A85 RID: 2693
		protected Vector3 previousNearestNeighborOriginVector3;

		// Token: 0x04000A86 RID: 2694
		protected Transform previousNearestNeighborOriginTransform;

		// Token: 0x04000A87 RID: 2695
		protected Vector3 nearestNeighborOriginTransformPosition;

		// Token: 0x04000A88 RID: 2696
		protected MASKSORTINGC previousMaskSorting;

		// Token: 0x04000A89 RID: 2697
		protected VALUEMETHOD previousLifetimeValueMethod;

		// Token: 0x04000A8A RID: 2698
		protected float previousLifetime;

		// Token: 0x04000A8B RID: 2699
		protected float previousLifetimeMin;

		// Token: 0x04000A8C RID: 2700
		protected float previousLifetimeEmission;

		// Token: 0x04000A8D RID: 2701
		protected bool previousEmission = true;

		// Token: 0x04000A8E RID: 2702
		protected bool previousLoop;

		// Token: 0x04000A8F RID: 2703
		protected float emissionStopped;

		// Token: 0x04000A90 RID: 2704
		protected bool queueEmissionHalt;

		// Token: 0x04000A91 RID: 2705
		protected bool hasEmitted;

		// Token: 0x04000A92 RID: 2706
		protected int lifetimeColorId;

		// Token: 0x04000A93 RID: 2707
		protected System.Random internalRandom01;

		// Token: 0x04000A94 RID: 2708
		protected float lastTimeUpdated;

		// Token: 0x04000A95 RID: 2709
		protected PlaygroundEventParticle eventParticle = new PlaygroundEventParticle();

		// Token: 0x04000A96 RID: 2710
		[NonSerialized]
		public bool cameFromNonCalculatedFrame;

		// Token: 0x04000A97 RID: 2711
		[NonSerialized]
		public bool cameFromNonEmissionFrame = true;

		// Token: 0x04000A98 RID: 2712
		[NonSerialized]
		public float localTime;

		// Token: 0x04000A99 RID: 2713
		[NonSerialized]
		public float localDeltaTime;

		// Token: 0x04000A9A RID: 2714
		[NonSerialized]
		public int previousActiveState;

		// Token: 0x04000A9B RID: 2715
		[NonSerialized]
		public float simulationStarted;

		// Token: 0x04000A9C RID: 2716
		[NonSerialized]
		public bool inPlayback;

		// Token: 0x04000A9D RID: 2717
		[NonSerialized]
		public bool loopExceeded;

		// Token: 0x04000A9E RID: 2718
		[NonSerialized]
		public int loopExceededOnParticle;

		// Token: 0x04000A9F RID: 2719
		[NonSerialized]
		public bool isReadyForThreadedCalculations;

		// Token: 0x04000AA0 RID: 2720
		[NonSerialized]
		public bool hasActiveParticles = true;

		// Token: 0x04000AA1 RID: 2721
		[NonSerialized]
		public bool isDoneThread = true;

		// Token: 0x04000AA2 RID: 2722
		[NonSerialized]
		public bool threadHadNoActiveParticles;

		// Token: 0x04000AA3 RID: 2723
		protected bool hasEventManipulatorLocal;

		// Token: 0x04000AA4 RID: 2724
		protected bool hasEventManipulatorGlobal;

		// Token: 0x04000AA5 RID: 2725
		protected bool hasSeveralManipulatorEvents;

		// Token: 0x04000AA6 RID: 2726
		protected bool hasGlobalAffectingManipulators;

		// Token: 0x04000AA7 RID: 2727
		protected Quaternion particleSystemRotation;

		// Token: 0x04000AA8 RID: 2728
		protected Quaternion particleSystemInverseRotation;

		// Token: 0x04000AA9 RID: 2729
		protected int psTransformNum = -1;

		// Token: 0x04000AAA RID: 2730
		protected Vector3 manipulatorFix = new Vector3(0f, 0.0001f, 0f);

		// Token: 0x04000AAB RID: 2731
		protected PlaygroundParticlesC thisInstance;

		// Token: 0x04000AAC RID: 2732
		protected float t;

		// Token: 0x04000AAD RID: 2733
		protected bool cancelDeltaPositioningOnSync;

		// Token: 0x04000AAE RID: 2734
		protected Quaternion stCompensationRot;

		// Token: 0x04000AAF RID: 2735
		protected Quaternion stCompensationRotPrev;

		// Token: 0x04000AB0 RID: 2736
		protected Quaternion stRot;

		// Token: 0x04000AB1 RID: 2737
		protected Vector3 stDir;

		// Token: 0x04000AB2 RID: 2738
		protected bool localSpace;

		// Token: 0x04000AB3 RID: 2739
		protected bool overflow;

		// Token: 0x04000AB4 RID: 2740
		protected bool skinnedWorldObjectReady;

		// Token: 0x04000AB5 RID: 2741
		protected bool stateReadyForTextureColor;

		// Token: 0x04000AB6 RID: 2742
		protected int manipulatorEventCount;

		// Token: 0x04000AB7 RID: 2743
		protected bool hasEvent;

		// Token: 0x04000AB8 RID: 2744
		protected bool hasTimerEvent;

		// Token: 0x04000AB9 RID: 2745
		protected bool hasCollisionCache;

		// Token: 0x04000ABA RID: 2746
		protected int reportUpdateStepper = 100;

		// Token: 0x04000ABB RID: 2747
		protected bool isReportingBadUpdateRate;

		// Token: 0x04000ABC RID: 2748
		protected bool isSettingLifetime;

		// Token: 0x04000ABD RID: 2749
		protected bool isSettingParticleTime;

		// Token: 0x04000ABE RID: 2750
		protected bool isSettingParticleCount;

		// Token: 0x04000ABF RID: 2751
		protected bool prevLoop;

		// Token: 0x04000AC0 RID: 2752
		protected SOURCEC prevSource;

		// Token: 0x04000AC1 RID: 2753
		protected float realSimulationTime;

		// Token: 0x04000AC2 RID: 2754
		protected bool isSaving;

		// Token: 0x04000AC3 RID: 2755
		protected bool isLoading;

		// Token: 0x04000AC4 RID: 2756
		protected bool transitionAvailable;

		// Token: 0x04000AC5 RID: 2757
		protected bool abortTransition;

		// Token: 0x04000AC6 RID: 2758
		protected bool isYieldRefreshing;

		// Token: 0x04000AC7 RID: 2759
		protected bool initialized;
	}
}
